diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2017-01-20 21:59:52 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2017-01-20 21:59:52 -0500 |
commit | d36614407550de7a8fc977b94e1cf104c9a2ead4 (patch) | |
tree | 2de329498f3dc2ed6975769540a013e00daee841 /tests/test_oddball.py | |
parent | f28ab3b850586fd7531af7473ac2a93f8214d190 (diff) | |
download | python-coveragepy-git-d36614407550de7a8fc977b94e1cf104c9a2ead4.tar.gz |
Get rid of some unused code paths
Diffstat (limited to 'tests/test_oddball.py')
-rw-r--r-- | tests/test_oddball.py | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/tests/test_oddball.py b/tests/test_oddball.py index 1cdadf6f..5a331a29 100644 --- a/tests/test_oddball.py +++ b/tests/test_oddball.py @@ -119,7 +119,7 @@ class RecursionTest(CoverageTest): pytrace = (cov.collector.tracer_name() == "PyTracer") expected_missing = [3] - if pytrace: + if pytrace: # pragma: no metacov expected_missing += [9, 10, 11] _, statements, missing, _ = cov.analysis("recur.py") @@ -127,7 +127,7 @@ class RecursionTest(CoverageTest): self.assertEqual(missing, expected_missing) # Get a warning about the stackoverflow effect on the tracing function. - if pytrace: + if pytrace: # pragma: no metacov self.assertEqual(cov._warnings, ["Trace function changed, measurement is likely wrong: None"] ) @@ -400,15 +400,11 @@ class DoctestTest(CoverageTest): def setUp(self): super(DoctestTest, self).setUp() - # Oh, the irony! This test case exists because Python 2.4's - # doctest module doesn't play well with coverage. But nose fixes - # the problem by monkeypatching doctest. I want to undo the - # monkeypatch to be sure I'm getting the doctest module that users - # of coverage will get. Deleting the imported module here is - # enough: when the test imports doctest again, it will get a fresh - # copy without the monkeypatch. - if 'doctest' in sys.modules: - del sys.modules['doctest'] + # This test case exists because Python 2.4's doctest module didn't play + # well with coverage. Nose fixes the problem by monkeypatching doctest. + # I want to be sure there's no monkeypatch and that I'm getting the + # doctest module that users of coverage will get. + assert 'doctest' not in sys.modules def test_doctest(self): self.check_coverage('''\ |