3 ^ @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. NcCstjdtdS)NZrw)warningswarnRuntimeWarningrr4/usr/lib64/python3.6/unittest/test/_test_warnings.pywarnfunsrc@sDeZdZddZddZddZddZd d Zd d Zd dZ dS) TestWarningscCs(|jdd|jdd|jdddS)Nr r r )Z assertEquals)selfrrr test_asserts  zTestWarnings.test_assertcCs|jd|jddS)NT)Z failUnless)r rrr test_fails zTestWarnings.test_failcCs|jdd|jdddS)Nr r r )ZassertAlmostEqualZassertNotAlmostEqual)r rrrtest_other_unittest s z TestWarnings.test_other_unittestcCs(tjdttjdttjdtdS)NZdw)rrDeprecationWarning)r rrrtest_deprecation%s  zTestWarnings.test_deprecationcCs(tjdttjdttjdtdS)NZiw)rr ImportWarning)r rrr test_import*s  zTestWarnings.test_importcCs"tjdtjdtjddS)NZuw)rr)r rrr test_warning0s  zTestWarnings.test_warningcCstttdS)N)r)r rrr test_function7szTestWarnings.test_functionN) __name__ __module__ __qualname__r rrrrrrrrrrrsr__main__T)recordr F)exitr)r)__doc__sysZunittestrrZTestCaserrcatch_warningsZwslenargvmainpopwprintmessagerrrr s+