summaryrefslogtreecommitdiff
path: root/tests/test_coverage.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-11-13 19:23:24 -0500
committerNed Batchelder <ned@nedbatchelder.com>2021-11-14 08:12:49 -0500
commitb82e9fd8766a77c2a275bde7b574f3e8cb529f8f (patch)
treef310ea38a19f2b4e8c93ee3e3a5b8a99aa43351a /tests/test_coverage.py
parent342e7da2941ae5291f1a94b6ad66ce489f6985fe (diff)
downloadpython-coveragepy-git-nedbat/exceptions.tar.gz
refactor: specialize exceptionsnedbat/exceptions
CoverageException is fine as a base class, but not good to use for raising (and catching sometimes). Introduce specialized exceptions that allow third-party tools to integrate better.
Diffstat (limited to 'tests/test_coverage.py')
-rw-r--r--tests/test_coverage.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_coverage.py b/tests/test_coverage.py
index d69a0418..9fc7a001 100644
--- a/tests/test_coverage.py
+++ b/tests/test_coverage.py
@@ -7,7 +7,7 @@ import pytest
import coverage
from coverage import env
-from coverage.exceptions import CoverageException
+from coverage.exceptions import NoDataError
from tests.coveragetest import CoverageTest
@@ -1850,19 +1850,19 @@ class ReportingTest(CoverageTest):
def test_no_data_to_report_on_annotate(self):
# Reporting with no data produces a nice message and no output
# directory.
- with pytest.raises(CoverageException, match="No data to report."):
+ with pytest.raises(NoDataError, match="No data to report."):
self.command_line("annotate -d ann")
self.assert_doesnt_exist("ann")
def test_no_data_to_report_on_html(self):
# Reporting with no data produces a nice message and no output
# directory.
- with pytest.raises(CoverageException, match="No data to report."):
+ with pytest.raises(NoDataError, match="No data to report."):
self.command_line("html -d htmlcov")
self.assert_doesnt_exist("htmlcov")
def test_no_data_to_report_on_xml(self):
# Reporting with no data produces a nice message.
- with pytest.raises(CoverageException, match="No data to report."):
+ with pytest.raises(NoDataError, match="No data to report."):
self.command_line("xml")
self.assert_doesnt_exist("coverage.xml")