diff options
author | Christian Heimes <christian@cheimes.de> | 2007-11-27 21:34:01 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2007-11-27 21:34:01 (GMT) |
commit | c756d00cf20ba094a93f09647e80b688ded61bf5 (patch) | |
tree | b9c04d37004dbc6e299afdeeea5cd88d1f1189f9 /Lib/test/test_doctest.py | |
parent | 8b01140d2c0580258281b22a63e13eb43c897827 (diff) | |
download | cpython-c756d00cf20ba094a93f09647e80b688ded61bf5.zip cpython-c756d00cf20ba094a93f09647e80b688ded61bf5.tar.gz cpython-c756d00cf20ba094a93f09647e80b688ded61bf5.tar.bz2 |
Replaced import of the 'new' module with 'types' module and added a deprecation warning to the 'new' module.
Diffstat (limited to 'Lib/test/test_doctest.py')
-rw-r--r-- | Lib/test/test_doctest.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py index 7c78d3f..4e0c1f8 100644 --- a/Lib/test/test_doctest.py +++ b/Lib/test/test_doctest.py @@ -448,8 +448,8 @@ docstring, and will recursively explore its contents, including functions, classes, and the `__test__` dictionary, if it exists: >>> # A module - >>> import new - >>> m = new.module('some_module') + >>> import types + >>> m = types.ModuleType('some_module') >>> def triple(val): ... ''' ... >>> print triple(11) @@ -1937,11 +1937,11 @@ def test_DocFileSuite(): If DocFileSuite is used from an interactive session, then files are resolved relative to the directory of sys.argv[0]: - >>> import new, os.path, test.test_doctest + >>> import types, os.path, test.test_doctest >>> save_argv = sys.argv >>> sys.argv = [test.test_doctest.__file__] >>> suite = doctest.DocFileSuite('test_doctest.txt', - ... package=new.module('__main__')) + ... package=types.ModuleType('__main__')) >>> sys.argv = save_argv By setting `module_relative=False`, os-specific paths may be @@ -2366,9 +2366,9 @@ def old_test3(): r""" """ def old_test4(): """ - >>> import new - >>> m1 = new.module('_m1') - >>> m2 = new.module('_m2') + >>> import types + >>> m1 = types.ModuleType('_m1') + >>> m2 = types.ModuleType('_m2') >>> test_data = \""" ... def _f(): ... '''>>> assert 1 == 1 |