Skip to content

Commit

Permalink
update tests/docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hiramf authored Sep 18, 2023
1 parent 16e6efa commit a24df3e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion doc/cmd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ Module XXX was never imported (module-not-imported)
You asked coverage.py to measure module XXX, but it was never imported by
your program.

No data was collected (no-data-collected)
No data were collected (no-data-collected)
Coverage.py ran your program, but didn't measure any lines as executed.
This could be because you asked to measure only modules that never ran,
or for other reasons.
Expand Down
12 changes: 6 additions & 6 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def test_completely_zero_reporting(self) -> None:
cov = coverage.Coverage(source=["foo"])
self.start_import_stop(cov, "test")
cov.report()
assert_coverage_warnings(warns, "No data was collected. (no-data-collected)")
assert_coverage_warnings(warns, "No data were collected. (no-data-collected)")
# Name Stmts Miss Cover
# --------------------------------
# foo/bar.py 1 1 0%
Expand Down Expand Up @@ -383,7 +383,7 @@ def test_two_getdata_only_warn_once(self) -> None:
with cov.collect():
import_local_file("code1")
# We didn't collect any data, so we should get a warning.
with self.assert_warnings(cov, ["No data was collected"]):
with self.assert_warnings(cov, ["No data were collected"]):
cov.get_data()
# But calling get_data a second time with no intervening activity
# won't make another warning.
Expand All @@ -396,11 +396,11 @@ def test_two_getdata_warn_twice(self) -> None:
with cov.collect():
import_local_file("code1")
# We didn't collect any data, so we should get a warning.
with self.assert_warnings(cov, ["No data was collected"]):
with self.assert_warnings(cov, ["No data were collected"]):
cov.save()
import_local_file("code2")
# Calling get_data a second time after tracing some more will warn again.
with self.assert_warnings(cov, ["No data was collected"]):
with self.assert_warnings(cov, ["No data were collected"]):
cov.get_data()

def make_good_data_files(self) -> None:
Expand Down Expand Up @@ -541,7 +541,7 @@ def test_warnings(self) -> None:
"Module sys has no Python source. (module-not-python)",
"Module xyzzy was never imported. (module-not-imported)",
"Module quux was never imported. (module-not-imported)",
"No data was collected. (no-data-collected)",
"No data were collected. (no-data-collected)",
)

def test_warnings_suppressed(self) -> None:
Expand Down Expand Up @@ -1240,7 +1240,7 @@ def test_combine_no_suffix_multiprocessing(self) -> None:
# The warning isn't the point of this test, but suppress it.
with pytest.warns(Warning) as warns:
cov.combine()
assert_coverage_warnings(warns, "No data was collected. (no-data-collected)")
assert_coverage_warnings(warns, "No data were collected. (no-data-collected)")
cov.save()
self.assert_file_count(".coverage.*", 0)
self.assert_exists(".coverage")
Expand Down

0 comments on commit a24df3e

Please sign in to comment.