summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-05-27 21:33:07 -0400
committerNed Batchelder <ned@nedbatchelder.com>2015-05-27 21:33:07 -0400
commitdd7d9a4450dc80668dabe33262ffee18648b4b88 (patch)
tree5821cad952a35f47fd355deda7c125a61b68fe17
parent8cd9f957daff3d9752a79dbf7c47c2e5c5b6fe34 (diff)
downloadpython-coveragepy-git-dd7d9a4450dc80668dabe33262ffee18648b4b88.tar.gz
Dict literals changed in 3.5b1
-rw-r--r--coverage/env.py5
-rw-r--r--tests/test_arcs.py7
2 files changed, 9 insertions, 3 deletions
diff --git a/coverage/env.py b/coverage/env.py
index af78844e..c1d838b1 100644
--- a/coverage/env.py
+++ b/coverage/env.py
@@ -11,8 +11,9 @@ LINUX = sys.platform == "linux2"
PYPY = '__pypy__' in sys.builtin_module_names
# Python versions.
-PY2 = sys.version_info < (3, 0)
-PY3 = sys.version_info >= (3, 0)
+PYVERSION = sys.version_info
+PY2 = PYVERSION < (3, 0)
+PY3 = PYVERSION >= (3, 0)
# Coverage.py specifics.
diff --git a/tests/test_arcs.py b/tests/test_arcs.py
index a4462ea1..c0cbac7c 100644
--- a/tests/test_arcs.py
+++ b/tests/test_arcs.py
@@ -672,6 +672,11 @@ class MiscArcTest(CoverageTest):
"""Miscellaneous arc-measuring tests."""
def test_dict_literal(self):
+ if env.PYVERSION < (3, 5):
+ arcz = ".1 19 9."
+ else:
+ # Python 3.5 changed how dict literals are constructed.
+ arcz = ".1 19 9-2"
self.check_coverage("""\
d = {
'a': 2,
@@ -683,7 +688,7 @@ class MiscArcTest(CoverageTest):
}
assert d
""",
- arcz=".1 19 9.")
+ arcz=arcz)
def test_pathologically_long_code_object(self):
# https://bitbucket.org/ned/coveragepy/issue/359