ϪftdZddlZddlmZddlmZddlmZGddZGdd eejZ y) z2 Tests for warning suppression features of Trial. N)namedAny)unittest) suppressioncFeZdZdZdZdZdZdZdZdZ dZ d Z d Z y ) SuppressionMixinzj Tests for the warning suppression features of L{twisted.trial.unittest.SynchronousTestCase}. cJ|jtjy)N)runpyunit TestResult)selfsuites E/usr/lib/python3/dist-packages/twisted/trial/test/test_suppression.pyrunTestszSuppressionMixin.runTestss &##%&c:tj||gS)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 TestSuite)r cls methodNames r_loadzSuppressionMixin._loadsZ 122rcT|j|Dcgc]}|d c}|ycc}w)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. messageN) assertEqual)r warningswhichwarnings r_assertWarningsz SuppressionMixin._assertWarnings#s' HE'),EuMEs %cB|j|j|jd|j|jjg}|j |t jt jt jt jgy)z Suppressions defined by the test method being run are applied to any warnings emitted while running the C{setUp} fixture. testSuppressMethodN) rrTestSetUpSuppression flushWarnings_emitrrCLASS_WARNING_MSGMODULE_WARNING_MSGr warningsShowns rtest_setUpSuppressionz&SuppressionMixin.test_setUpSuppression4s{ djj!:!:twisted.trial.test.suppression.SynchronousTestSetUpSuppressionzAtwisted.trial.test.suppression.SynchronousTestTearDownSuppressionz9twisted.trial.test.suppression.SynchronousTestSuppressionz:twisted.trial.test.suppression.SynchronousTestSuppression2N) r<r=r>r?rrr(r+r6r@rrrBrBsF$H'KCO DrrB) r?rr twisted.python.reflectr twisted.trialtwisted.trial.testrrSynchronousTestCaserBr@rrrGs: +"*u0u0p"2H4P4Pr