summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2018-01-10 21:58:34 -0500
committerNed Batchelder <ned@nedbatchelder.com>2018-01-10 21:58:34 -0500
commite2d74b02a1e08e58ddd797b289d002d95e6ec2c1 (patch)
tree9650faa8bdb38b194eabbadca86389d4a4a2fe67
parent392d901aba3930243c516ee2a9ef00a090357ac6 (diff)
downloadpython-coveragepy-e2d74b02a1e08e58ddd797b289d002d95e6ec2c1.tar.gz
Python 3.7 optimizes away 'not __debug__'
-rw-r--r--tests/test_arcs.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/test_arcs.py b/tests/test_arcs.py
index 7df623b..2111c9b 100644
--- a/tests/test_arcs.py
+++ b/tests/test_arcs.py
@@ -1122,7 +1122,13 @@ class OptimizedIfTest(CoverageTest):
""",
arcz=".1 12 24 41 26 61 1.",
)
- # No Python optimizes away "if not __debug__:"
+ # Before 3.7, no Python optimized away "if not __debug__:"
+ if env.PYVERSION < (3, 7):
+ arcz = ".1 12 23 31 34 41 26 61 1."
+ arcz_missing = "34 41"
+ else:
+ arcz = ".1 12 23 31 26 61 1."
+ arcz_missing = ""
self.check_coverage("""\
for value in [True, False]:
if value:
@@ -1131,8 +1137,8 @@ class OptimizedIfTest(CoverageTest):
else:
x = 6
""",
- arcz=".1 12 23 31 34 41 26 61 1.",
- arcz_missing="34 41",
+ arcz=arcz,
+ arcz_missing=arcz_missing,
)