summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2018-06-13 07:22:44 -0400
committerNed Batchelder <ned@nedbatchelder.com>2018-06-13 07:22:44 -0400
commit8487f53182564a40d8283d1433ce16cfdf921059 (patch)
treee663d1716adee0ed0d6c53c47464100a7e031bff
parentb608ea91228c87835a932703269050f57c6b8813 (diff)
downloadpython-coveragepy-8487f53182564a40d8283d1433ce16cfdf921059.tar.gz
Adapt to a recent 3.7 change in how functions with only docstrings get line-numbered
-rw-r--r--tests/test_parser.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/test_parser.py b/tests/test_parser.py
index 184825b..034e9aa 100644
--- a/tests/test_parser.py
+++ b/tests/test_parser.py
@@ -197,8 +197,14 @@ class PythonParserTest(CoverageTest):
pass
""")
self.assertEqual(parser.statements, set([1, 2, 4, 8, 10]))
- self.assertEqual(parser.arcs(), set(self.arcz_to_arcs(".1 14 48 8. .2 2. -8A A-8")))
- self.assertEqual(parser.exit_counts(), {1: 1, 2: 1, 4: 1, 8: 1, 10: 1})
+ expected_arcs = set(self.arcz_to_arcs(".1 14 48 8. .2 2. -8A A-8"))
+ expected_exits = {1: 1, 2: 1, 4: 1, 8: 1, 10: 1}
+ if env.PYVERSION >= (3, 7, 0, 'beta', 5):
+ # 3.7 changed how functions with only docstrings were numbered.
+ expected_arcs.update(set(self.arcz_to_arcs("-46 6-4")))
+ expected_exits.update({6: 1})
+ self.assertEqual(parser.arcs(), expected_arcs)
+ self.assertEqual(parser.exit_counts(), expected_exits)
class ParserMissingArcDescriptionTest(CoverageTest):