summaryrefslogtreecommitdiff
path: root/tests/test_plugins.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_plugins.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_plugins.py')
-rw-r--r--tests/test_plugins.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/test_plugins.py b/tests/test_plugins.py
index 5d3b5322..2140f00c 100644
--- a/tests/test_plugins.py
+++ b/tests/test_plugins.py
@@ -14,7 +14,7 @@ import coverage
from coverage import env
from coverage.control import Plugins
from coverage.data import line_counts
-from coverage.exceptions import CoverageException, CoverageWarning
+from coverage.exceptions import CoverageWarning, NoSource, PluginError
from coverage.misc import import_local_file
import coverage.plugin
@@ -133,7 +133,7 @@ class LoadPluginsTest(CoverageTest):
Nothing = 0
""")
msg_pat = "Plugin module 'no_plugin' didn't define a coverage_init function"
- with pytest.raises(CoverageException, match=msg_pat):
+ with pytest.raises(PluginError, match=msg_pat):
list(Plugins.load_plugins(["no_plugin"], None))
@@ -576,7 +576,7 @@ class GoodFileTracerTest(FileTracerTest):
# But completely new filenames are not in the results.
assert len(cov.get_data().measured_files()) == 3
- with pytest.raises(CoverageException):
+ with pytest.raises(NoSource):
cov.analysis("fictional.py")