summaryrefslogtreecommitdiff
path: root/tests/test_lcov.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2022-01-22 15:19:23 -0500
committerNed Batchelder <ned@nedbatchelder.com>2022-01-22 16:48:59 -0500
commit3f221e0339b74137bbf45289497955700dc49feb (patch)
tree59530795e7037508e4590264561adc281e2f28ab /tests/test_lcov.py
parentcbe2e205dac99f20afff4ccdeca21fd10d596565 (diff)
downloadpython-coveragepy-git-3f221e0339b74137bbf45289497955700dc49feb.tar.gz
fix: small fixes to lcov, and changes.rst mention.
Diffstat (limited to 'tests/test_lcov.py')
-rw-r--r--tests/test_lcov.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/test_lcov.py b/tests/test_lcov.py
index 9d2f8ec6..fcb17f93 100644
--- a/tests/test_lcov.py
+++ b/tests/test_lcov.py
@@ -49,9 +49,8 @@ class LcovTest(CoverageTest):
""",
)
- def get_lcov_report_content(self):
- """Return the content of the LCOV report."""
- filename = "coverage.lcov"
+ def get_lcov_report_content(self, filename="coverage.lcov"):
+ """Return the content of an LCOV report."""
with open(filename, "r") as file:
file_contents = file.read()
return file_contents
@@ -96,10 +95,11 @@ class LcovTest(CoverageTest):
and matches the output of the file below."""
self.create_initial_files()
self.assert_doesnt_exist(".coverage")
+ self.make_file(".coveragerc", "[lcov]\noutput = data.lcov\n")
cov = coverage.Coverage(source=".")
self.start_import_stop(cov, "test_file")
cov.lcov_report()
- self.assert_exists("coverage.lcov")
+ self.assert_exists("data.lcov")
expected_result = """\
TN:
SF:main_file.py
@@ -125,7 +125,7 @@ class LcovTest(CoverageTest):
end_of_record
"""
expected_result = textwrap.dedent(expected_result)
- actual_result = self.get_lcov_report_content()
+ actual_result = self.get_lcov_report_content(filename="data.lcov")
assert expected_result == actual_result
def test_branch_coverage_one_file(self):