Skip to content

Commit

Permalink
wip: add a test for #1874
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Dec 23, 2024
1 parent f459ee8 commit ca4fd8d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/test_lcov.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,3 +572,19 @@ def fun(x):
cov.lcov_report()
lcov = self.get_lcov_report_content()
assert "BRDA:2,0,return from function 'fun',-" in lcov

def test_module_exit(self) -> None:
self.make_file("modexit.py", """\
#! /usr/bin/env python
def foo():
return bar(
)
if "x" == "y": # line 5
foo()
""")
cov = coverage.Coverage(source=".", branch=True)
self.start_import_stop(cov, "modexit")
cov.lcov_report()
lcov = self.get_lcov_report_content()
print(lcov)
assert "BRDA:5,0,exit the module,1" in lcov

0 comments on commit ca4fd8d

Please sign in to comment.