summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2020-12-31 18:26:00 -0500
committerNed Batchelder <ned@nedbatchelder.com>2021-01-10 09:46:18 -0500
commitbd90b202587dd9f1e2e1319c1c542545c7263dd3 (patch)
tree0ea3dff2903cb5be1869dde55434e93e2677ccff /tests
parent13f15b0e4316865287d4b5ae1d4f856dac9f9ecb (diff)
downloadpython-coveragepy-git-bd90b202587dd9f1e2e1319c1c542545c7263dd3.tar.gz
In 3.10, modules always have firstlineno==1
Diffstat (limited to 'tests')
-rw-r--r--tests/coveragetest.py5
-rw-r--r--tests/test_arcs.py4
2 files changed, 8 insertions, 1 deletions
diff --git a/tests/coveragetest.py b/tests/coveragetest.py
index f4961ed9..b2763b04 100644
--- a/tests/coveragetest.py
+++ b/tests/coveragetest.py
@@ -219,6 +219,11 @@ class CoverageTest(
self.fail("None of the missing choices matched %r" % missing_formatted)
if arcs is not None:
+ # print("Possible arcs:")
+ # print(" expected:", arcs)
+ # print(" actual:", analysis.arc_possibilities())
+ # print("Executed:")
+ # print(" actual:", sorted(set(analysis.arcs_executed())))
with self.delayed_assertions():
self.assert_equal_arcs(
arcs, analysis.arc_possibilities(),
diff --git a/tests/test_arcs.py b/tests/test_arcs.py
index 849dbc4a..b927526b 100644
--- a/tests/test_arcs.py
+++ b/tests/test_arcs.py
@@ -25,6 +25,7 @@ class SimpleArcTest(CoverageTest):
b = 3
""",
arcz=".1 13 3.")
+ line1 = 1 if env.PYBEHAVIOR.module_firstline_1 else 2
self.check_coverage("""\
a = 2
@@ -32,7 +33,8 @@ class SimpleArcTest(CoverageTest):
c = 5
""",
- arcz="-22 23 35 5-2")
+ arcz="-{0}2 23 35 5-{0}".format(line1)
+ )
def test_function_def(self):
self.check_coverage("""\