diff options
-rw-r--r-- | tests/coveragetest.py | 8 | ||||
-rw-r--r-- | tests/test_arcs.py | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/tests/coveragetest.py b/tests/coveragetest.py index 8541ed28..aae4df08 100644 --- a/tests/coveragetest.py +++ b/tests/coveragetest.py @@ -433,6 +433,14 @@ class CoverageTest( return {os.path.basename(filename): filename for filename in coverage_data.measured_files()} + def get_missing_arc_description(self, cov, start, end): + """Get the missing-arc description for a line arc in a coverage run.""" + # ugh, unexposed methods?? + filename = self.last_module_name + ".py" + fr = cov._get_file_reporter(filename) + arcs_executed = cov._analyze(filename).arcs_executed() + return fr.missing_arc_description(start, end, arcs_executed) + class UsingModulesMixin: """A mixin for importing modules from tests/modules and tests/moremodules.""" diff --git a/tests/test_arcs.py b/tests/test_arcs.py index b2d75377..5059fdc7 100644 --- a/tests/test_arcs.py +++ b/tests/test_arcs.py @@ -1583,14 +1583,10 @@ class MiscArcTest(CoverageTest): arcz=".1 17 7. .2 23 34 45 5. -22 2-2 -33 3-3 -44 4-4", arcz_missing="3-3 -44 4-4", ) - # ugh, unexposed methods?? - filename = self.last_module_name + ".py" - fr = cov._get_file_reporter(filename) - arcs_executed = cov._analyze(filename).arcs_executed() expected = "line 3 didn't finish the generator expression on line 3" - assert expected == fr.missing_arc_description(3, -3, arcs_executed) + assert self.get_missing_arc_description(cov, 3, -3) == expected expected = "line 4 didn't run the generator expression on line 4" - assert expected == fr.missing_arc_description(4, -4, arcs_executed) + assert self.get_missing_arc_description(cov, 4, -4) == expected class DecoratorArcTest(CoverageTest): |