Back to index

python3.2  3.2.2
Classes | Functions | Variables
test.test_warnings Namespace Reference

Classes

class  BaseTest
class  FilterTests
class  CFilterTests
class  PyFilterTests
class  WarnTests
class  CWarnTests
class  PyWarnTests
class  WCmdLineTests
class  CWCmdLineTests
class  PyWCmdLineTests
class  _WarningsTests
class  WarningsDisplayTests
class  CWarningsDisplayTests
class  PyWarningsDisplayTests
class  CatchWarningTests
class  CCatchWarningTests
class  PyCatchWarningTests
class  EnvironmentVariableTests
class  CEnvironmentVariableTests
class  PyEnvironmentVariableTests
class  BootstrapTest

Functions

def warnings_state
def test_main

Variables

tuple py_warnings = support.import_fresh_module('warnings', blocked=['_warnings'])
tuple c_warnings = support.import_fresh_module('warnings', fresh=['_warnings'])

Function Documentation

Definition at line 789 of file test_warnings.py.

00789 
00790 def test_main():
00791     py_warnings.onceregistry.clear()
00792     c_warnings.onceregistry.clear()
00793     support.run_unittest(
00794         CFilterTests, PyFilterTests,
00795         CWarnTests, PyWarnTests,
00796         CWCmdLineTests, PyWCmdLineTests,
00797         _WarningsTests,
00798         CWarningsDisplayTests, PyWarningsDisplayTests,
00799         CCatchWarningTests, PyCatchWarningTests,
00800         CEnvironmentVariableTests, PyEnvironmentVariableTests,
00801         BootstrapTest,
00802     )
00803 

Use a specific warnings implementation in warning_tests.

Definition at line 19 of file test_warnings.py.

00019 
00020 def warnings_state(module):
00021     """Use a specific warnings implementation in warning_tests."""
00022     global __warningregistry__
00023     for to_clear in (sys, warning_tests):
00024         try:
00025             to_clear.__warningregistry__.clear()
00026         except AttributeError:
00027             pass
00028     try:
00029         __warningregistry__.clear()
00030     except NameError:
00031         pass
00032     original_warnings = warning_tests.warnings
00033     original_filters = module.filters
00034     try:
00035         module.filters = original_filters[:]
00036         module.simplefilter("once")
00037         warning_tests.warnings = module
00038         yield
00039     finally:
00040         warning_tests.warnings = original_warnings
00041         module.filters = original_filters
00042 

Here is the caller graph for this function:


Variable Documentation

tuple test.test_warnings.c_warnings = support.import_fresh_module('warnings', fresh=['_warnings'])

Definition at line 16 of file test_warnings.py.

tuple test.test_warnings.py_warnings = support.import_fresh_module('warnings', blocked=['_warnings'])

Definition at line 15 of file test_warnings.py.