diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2018-01-10 21:58:34 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2018-01-10 21:58:34 -0500 |
commit | de242a2676b7f0605bd536a07e5faddef79aae2e (patch) | |
tree | c628b4e9d139a64da4e6459e2c297c7ef81499d0 | |
parent | e3761571cfe9c21baa138d58c1f304bdbca572ae (diff) | |
download | python-coveragepy-git-de242a2676b7f0605bd536a07e5faddef79aae2e.tar.gz |
Python 3.7 optimizes away 'not __debug__'
-rw-r--r-- | tests/test_arcs.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/test_arcs.py b/tests/test_arcs.py index 7df623bf..2111c9bc 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, ) |