From a24df3e0ce84a515195ab4fe227192f1454ac1c4 Mon Sep 17 00:00:00 2001 From: Hiram Foster Date: Mon, 18 Sep 2023 10:55:00 -0400 Subject: [PATCH] update tests/docs --- doc/cmd.rst | 2 +- tests/test_api.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/cmd.rst b/doc/cmd.rst index 90667cabd..1c60fbfda 100644 --- a/doc/cmd.rst +++ b/doc/cmd.rst @@ -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. diff --git a/tests/test_api.py b/tests/test_api.py index f0aee858a..40b555f7d 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -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% @@ -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. @@ -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: @@ -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: @@ -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")