diff options
author | Brett Cannon <bcannon@gmail.com> | 2011-02-22 03:04:06 (GMT) |
---|---|---|
committer | Brett Cannon <bcannon@gmail.com> | 2011-02-22 03:04:06 (GMT) |
commit | 7a54073a566080f3d7c10871f6ce244c9fc1221b (patch) | |
tree | c477930f8c868d6bdf9b8e65e7293bc2fdfe21ae /Lib/test/test_genexps.py | |
parent | eb70e47d85d52e0bafc6b6350b9b627e0b577e96 (diff) | |
download | cpython-7a54073a566080f3d7c10871f6ce244c9fc1221b.zip cpython-7a54073a566080f3d7c10871f6ce244c9fc1221b.tar.gz cpython-7a54073a566080f3d7c10871f6ce244c9fc1221b.tar.bz2 |
Issue #10992: make tests pass when run under coverage.
Various tests fail when run under coverage. A primary culprit is refcount tests
which fail as the counts are thrown off by the coverage code. A new decorator
-- test.support.refcount_test -- is used to decorate tests which test refcounts
and to skip them when running under coverage. Other tests simply fail because
of changes in the system (e.g., __local__ suddenly appearing).
Thanks to Kristian Vlaardingerbroek for helping to diagnose the test failures.
Diffstat (limited to 'Lib/test/test_genexps.py')
-rw-r--r-- | Lib/test/test_genexps.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_genexps.py b/Lib/test/test_genexps.py index 1f46af1..413043c 100644 --- a/Lib/test/test_genexps.py +++ b/Lib/test/test_genexps.py @@ -257,11 +257,15 @@ Verify that genexps are weakly referencable """ +import sys -__test__ = {'doctests' : doctests} +# Trace function can throw off the tuple reuse test. +if hasattr(sys, 'gettrace') and sys.gettrace(): + __test__ = {} +else: + __test__ = {'doctests' : doctests} def test_main(verbose=None): - import sys from test import support from test import test_genexps support.run_doctest(test_genexps, verbose) |