diff options
author | Eli Bendersky <eliben@gmail.com> | 2013-08-11 22:38:08 (GMT) |
---|---|---|
committer | Eli Bendersky <eliben@gmail.com> | 2013-08-11 22:38:08 (GMT) |
commit | ba5517d4c02ad9c8d7117fe8f063d2e680f1d9af (patch) | |
tree | d0d02afdce22ae3e20044957fca89c6151ab0925 /Doc/library | |
parent | b212291b08b8c7beffe8b2dbdd211ded05c84087 (diff) | |
download | cpython-ba5517d4c02ad9c8d7117fe8f063d2e680f1d9af.zip cpython-ba5517d4c02ad9c8d7117fe8f063d2e680f1d9af.tar.gz cpython-ba5517d4c02ad9c8d7117fe8f063d2e680f1d9af.tar.bz2 |
Issue #12645: Clarify and reformat the documentation of import_fresh_module
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/test.rst | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Doc/library/test.rst b/Doc/library/test.rst index 3f2980f..bce0f64 100644 --- a/Doc/library/test.rst +++ b/Doc/library/test.rst @@ -489,7 +489,7 @@ The :mod:`test.support` module defines the following functions: *fresh* is an iterable of additional module names that are also removed from the ``sys.modules`` cache before doing the import. - *blocked* is an iterable of module names that are replaced with :const:`0` + *blocked* is an iterable of module names that are replaced with ``None`` in the module cache during the import to ensure that attempts to import them raise :exc:`ImportError`. @@ -500,15 +500,15 @@ The :mod:`test.support` module defines the following functions: Module and package deprecation messages are suppressed during this import if *deprecated* is ``True``. - This function will raise :exc:`unittest.SkipTest` if the named module - cannot be imported. + This function will raise :exc:`ImportError` if the named module cannot be + imported. Example use:: - # Get copies of the warnings module for testing without - # affecting the version being used by the rest of the test suite - # One copy uses the C implementation, the other is forced to use - # the pure Python fallback implementation + # Get copies of the warnings module for testing without affecting the + # version being used by the rest of the test suite. One copy uses the + # C implementation, the other is forced to use the pure Python fallback + # implementation py_warnings = import_fresh_module('warnings', blocked=['_warnings']) c_warnings = import_fresh_module('warnings', fresh=['_warnings']) |