summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-12-24 21:42:37 -0500
committerNed Batchelder <ned@nedbatchelder.com>2015-12-24 21:42:37 -0500
commit5d767b89fc87b836f2cf93c4eb34252ee3bf1804 (patch)
treef0d7b157e6dd20c7db1f7c1c97bd3da85aa34a87
parent0a011554c83f185785fce8c7f4746d4fa050c55b (diff)
downloadpython-coveragepy-5d767b89fc87b836f2cf93c4eb34252ee3bf1804.tar.gz
if 0: might not do what we want, use a non-constant
-rw-r--r--tests/test_coverage.py10
-rw-r--r--tests/test_parser.py2
2 files changed, 6 insertions, 6 deletions
diff --git a/tests/test_coverage.py b/tests/test_coverage.py
index 02da203..0e5f495 100644
--- a/tests/test_coverage.py
+++ b/tests/test_coverage.py
@@ -1150,19 +1150,19 @@ class ExcludeTest(CoverageTest):
self.check_coverage("""\
a = 1; b = 2
- if 0:
+ if len([]): # not-here
a = 4
b = 5
c = 6
assert a == 1 and b == 2
""",
- [1,7], "", excludes=['if 0:'])
+ [1,7], "", excludes=['not-here'])
def test_excluding_if_but_not_else_suite(self):
self.check_coverage("""\
a = 1; b = 2
- if 0:
+ if len([]): # not-here
a = 4
b = 5
c = 6
@@ -1171,7 +1171,7 @@ class ExcludeTest(CoverageTest):
b = 9
assert a == 8 and b == 9
""",
- [1,8,9,10], "", excludes=['if 0:'])
+ [1,8,9,10], "", excludes=['not-here'])
def test_excluding_else_suite(self):
self.check_coverage("""\
@@ -1230,7 +1230,7 @@ class ExcludeTest(CoverageTest):
self.check_coverage("""\
def foo():
a = 2
- if 0: x = 3 # no cover
+ if len([]): x = 3 # no cover
b = 4
foo()
diff --git a/tests/test_parser.py b/tests/test_parser.py
index 44a261d..2a4c88a 100644
--- a/tests/test_parser.py
+++ b/tests/test_parser.py
@@ -81,7 +81,7 @@ class PythonParserTest(CoverageTest):
def __init__(self):
pass
- if 0: # nocover
+ if len([]): # nocover
class Bar:
pass
""")