3 ^ c @sdZddlZddlZddlZddZGdddejZedkrejdd 6Z e ej d krpej d ej j d n ej d d WdQRXxe D]ZeejqWdS)a This module has a number of tests that raise different kinds of warnings. When the tests are run, the warnings are caught and their messages are printed to stdout. This module also accepts an arg that is then passed to unittest.main to affect the behavior of warnings. Test_TextTestRunner.test_warnings executes this script with different combinations of warnings args and -W flags and check that the output is correct. See #10535. iNcCstjdtdS)NZrw)warningswarnZRuntimeWarningrr4/usr/lib64/python3.6/unittest/test/_test_warnings.pywarnfunsrc@sDeZdZddZddZddZddZd d Zd d Zd dZ dS) TestWarningscCs(|jdd|jdd|jdddS)Nrrr)Z assertEqualsZselfrrr test_assert  zTestWarnings.test_assertcCs|jd|jddS)NiT)Z failUnlessrrrr test_fails zTestWarnings.test_failcCs|jdd|jdddS)Nrrri)ZassertAlmostEqualZassertNotAlmostEqualrrrrtest_other_unittest s z TestWarnings.test_other_unittestcC(tjdttjdttjdtdS)NZdw)rrZDeprecationWarningrrrrtest_deprecation%r zTestWarnings.test_deprecationcCr )NZiw)rrZ ImportWarningrrrr test_import*r zTestWarnings.test_importcCs"tjdtjdtjddS)NZuw)rrrrrr test_warning0s  zTestWarnings.test_warningcCstttdS)N)rrrrr test_function7szTestWarnings.test_functionN) __name__Z __module__Z __qualname__r r r rrrrrrrrrsrZ__main__T)ZrecordrF)exitr)r)Z__doc__ZsysZunittestrrZTestCaserrZcatch_warningsZwsZlenZargvZmainZpopZwZprintZmessagerrrrZ s+