summaryrefslogtreecommitdiff
path: root/tests/test_coverage.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-12-25 07:34:09 -0500
committerNed Batchelder <ned@nedbatchelder.com>2015-12-25 07:34:09 -0500
commit8b110d3a3f7fbddfcbdaa1b090776e0f388a312e (patch)
tree19a32bf8dce35e63dd8b0a52002af24ac172eda5 /tests/test_coverage.py
parentdd5f8a759843724eaf278a7fa10f6b905d955b34 (diff)
downloadpython-coveragepy-git-8b110d3a3f7fbddfcbdaa1b090776e0f388a312e.tar.gz
Change if-0 skips to real skips in the tests
Diffstat (limited to 'tests/test_coverage.py')
-rw-r--r--tests/test_coverage.py52
1 files changed, 26 insertions, 26 deletions
diff --git a/tests/test_coverage.py b/tests/test_coverage.py
index 0e5f495a..ab4faf55 100644
--- a/tests/test_coverage.py
+++ b/tests/test_coverage.py
@@ -403,35 +403,35 @@ class SimpleStatementTest(CoverageTest):
""",
[1,2,3,4,5], "4")
- if 0: # expected failure
+ def test_strange_unexecuted_continue(self):
# Peephole optimization of jumps to jumps can mean that some statements
# never hit the line tracer. The behavior is different in different
# versions of Python, so don't run this test:
- def test_strange_unexecuted_continue(self):
- self.check_coverage("""\
- a = b = c = 0
- for n in range(100):
- if n % 2:
- if n % 4:
- a += 1
- continue # <-- This line may not be hit.
- else:
- b += 1
- c += 1
- assert a == 50 and b == 50 and c == 50
-
- a = b = c = 0
- for n in range(100):
- if n % 2:
- if n % 3:
- a += 1
- continue # <-- This line is always hit.
- else:
- b += 1
- c += 1
- assert a == 33 and b == 50 and c == 50
- """,
- [1,2,3,4,5,6,8,9,10, 12,13,14,15,16,17,19,20,21], "")
+ self.skip("Expected failure: peephole optimization of jumps to jumps")
+ self.check_coverage("""\
+ a = b = c = 0
+ for n in range(100):
+ if n % 2:
+ if n % 4:
+ a += 1
+ continue # <-- This line may not be hit.
+ else:
+ b += 1
+ c += 1
+ assert a == 50 and b == 50 and c == 50
+
+ a = b = c = 0
+ for n in range(100):
+ if n % 2:
+ if n % 3:
+ a += 1
+ continue # <-- This line is always hit.
+ else:
+ b += 1
+ c += 1
+ assert a == 33 and b == 50 and c == 50
+ """,
+ [1,2,3,4,5,6,8,9,10, 12,13,14,15,16,17,19,20,21], "")
def test_import(self):
self.check_coverage("""\