diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2010-04-27 21:51:26 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2010-04-27 21:51:26 (GMT) |
commit | edb9f873cfbf9d7f05cb73fa19036831813b28be (patch) | |
tree | 959ca2237c72237d686971eb5f07884aa75b23a7 | |
parent | 1b4a69d79bcdd50829ce871be703606211965e72 (diff) | |
download | cpython-edb9f873cfbf9d7f05cb73fa19036831813b28be.zip cpython-edb9f873cfbf9d7f05cb73fa19036831813b28be.tar.gz cpython-edb9f873cfbf9d7f05cb73fa19036831813b28be.tar.bz2 |
Issue #7449 part 3, test_doctest: import trace module in test_coverage()
Import trace module fail if the threading module is missing. test_coverage() is
only used if test_doctest.py is used with the -c option. This commit allows to
execute the test suite without thread support.
Move "import trace" in test_coverage() and use
test_support.import_module('trace').
-rw-r--r-- | Lib/test/test_doctest.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py index 4fc2f9f..df65d7e 100644 --- a/Lib/test/test_doctest.py +++ b/Lib/test/test_doctest.py @@ -2468,8 +2468,9 @@ def test_main(): # Check the doctest cases defined here: test_support.run_doctest(test_doctest, verbosity=True) -import trace, sys +import sys def test_coverage(coverdir): + trace = test_support.import_module('trace') tracer = trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix,], trace=0, count=1) tracer.run('reload(doctest); test_main()') |