diff options
-rw-r--r-- | tests/test_coverage.py | 7 | ||||
-rw-r--r-- | tests/test_parser.py | 10 |
2 files changed, 12 insertions, 5 deletions
diff --git a/tests/test_coverage.py b/tests/test_coverage.py index bda61fc6..fae85bc6 100644 --- a/tests/test_coverage.py +++ b/tests/test_coverage.py @@ -1124,6 +1124,11 @@ class CompoundStatementTest(CoverageTest): [1,10,12,13], "") def test_class_def(self): + if env.PYVERSION < (3, 7): + arcz="-22 2D DE E-2 23 36 6A A-2 -68 8-6 -AB B-A" + else: + # Python 3.7 no longer includes class docstrings in the lnotab table. + arcz="-22 2D DE E-2 26 6A A-2 -68 8-6 -AB B-A" self.check_coverage("""\ # A comment. class theClass: @@ -1141,7 +1146,7 @@ class CompoundStatementTest(CoverageTest): assert x == 1 """, [2, 6, 8, 10, 11, 13, 14], "", - arcz="-22 2D DE E-2 23 36 6A A-2 -68 8-6 -AB B-A", + arcz=arcz, ) diff --git a/tests/test_parser.py b/tests/test_parser.py index aa96b592..e9628ac7 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -165,10 +165,12 @@ class PythonParserTest(CoverageTest): def func(x=25): return 26 """) - self.assertEqual( - parser.raw_statements, - set([3, 4, 5, 6, 8, 9, 10, 13, 15, 16, 17, 20, 22, 23, 25, 26]) - ) + if env.PYVERSION < (3, 7): + raw_statements = set([3, 4, 5, 6, 8, 9, 10, 13, 15, 16, 17, 20, 22, 23, 25, 26]) + else: + # Python 3.7 no longer includes class docstrings in the lnotab table. + raw_statements = set([3, 4, 5, 6, 8, 10, 13, 15, 16, 17, 20, 22, 23, 25, 26]) + self.assertEqual(parser.raw_statements, raw_statements) self.assertEqual(parser.statements, set([8])) def test_class_decorator_pragmas(self): |