Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/twisted/trial/test/__pycache__/test_suppression.cpython-39.pyc
Ðазад
a k�h � @ sV d Z ddlZddlmZ ddlmZ ddlmZ G dd� d�ZG dd � d eej �Z dS ) z2 Tests for warning suppression features of Trial. � N)�namedAny)�unittest)�suppressionc @ sX e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � Z dd� Z dd� Zdd� ZdS )�SuppressionMixinzj Tests for the warning suppression features of L{twisted.trial.unittest.SynchronousTestCase}. c C s |� t�� � d S )N)�run�pyunitZ TestResult)�selfZsuite� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/twisted/trial/test/test_suppression.py�runTests s zSuppressionMixin.runTestsc C s t �||�g�S )z� Return a new L{unittest.TestSuite} with a single test method in it. @param cls: A L{TestCase} subclass defining a test method. @param methodName: The name of the test method from C{cls}. )r Z TestSuite)r �cls� methodNamer r r �_load s zSuppressionMixin._loadc C s | � dd� |D �|� dS )a& Assert that a certain number of warnings with certain messages were emitted in a certain order. @param warnings: A list of emitted warnings, as returned by C{flushWarnings}. @param which: A list of strings giving warning messages that should appear in C{warnings}. @raise self.failureException: If the warning messages given by C{which} do not match the messages in the warning information in C{warnings}, or if they do not appear in the same order. c S s g | ]}|d �qS )�messager )�.0�warningr r r � <listcomp>2 � z4SuppressionMixin._assertWarnings.<locals>.<listcomp>N)�assertEqual)r �warnings�whichr r r �_assertWarnings# s z SuppressionMixin._assertWarningsc C sD | � | �| jd�� | �| jjg�}| �|tjtjtjtjg� dS )z� Suppressions defined by the test method being run are applied to any warnings emitted while running the C{setUp} fixture. �testSuppressMethodN) r r �TestSetUpSuppression� flushWarnings�_emitr r �CLASS_WARNING_MSG�MODULE_WARNING_MSG�r Z warningsShownr r r �test_setUpSuppression4 s ��z&SuppressionMixin.test_setUpSuppressionc C sD | � | �| jd�� | �| jjg�}| �|tjtjtjtjg� dS )z� Suppressions defined by the test method being run are applied to any warnings emitted while running the C{tearDown} fixture. r N) r r �TestTearDownSuppressionr r r r r r r r r r �test_tearDownSuppressionE s ��z)SuppressionMixin.test_tearDownSuppressionc C s<