summaryrefslogtreecommitdiff
path: root/coverage/misc.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-05-01 22:38:55 -0400
committerNed Batchelder <ned@nedbatchelder.com>2021-05-02 07:38:20 -0400
commit6a3d3aaaf2aebb816c7287263c8097844280b233 (patch)
tree675124a02ef673e60ed4be951334beb17afd9489 /coverage/misc.py
parent3f19cd70ee61e126e1577302234bc23145a86dcf (diff)
downloadpython-coveragepy-git-6a3d3aaaf2aebb816c7287263c8097844280b233.tar.gz
refactor: move exceptions to their own module
Diffstat (limited to 'coverage/misc.py')
-rw-r--r--coverage/misc.py45
1 files changed, 1 insertions, 44 deletions
diff --git a/coverage/misc.py b/coverage/misc.py
index 52583589..db2c3b75 100644
--- a/coverage/misc.py
+++ b/coverage/misc.py
@@ -17,6 +17,7 @@ import sys
import types
from coverage import env
+from coverage.exceptions import CoverageException
ISOLATED_MODULES = {}
@@ -338,47 +339,3 @@ def import_local_file(modname, modfile=None):
spec.loader.exec_module(mod)
return mod
-
-
-class BaseCoverageException(Exception):
- """The base of all Coverage exceptions."""
- pass
-
-
-class CoverageException(BaseCoverageException):
- """An exception raised by a coverage.py function."""
- pass
-
-
-class NoSource(CoverageException):
- """We couldn't find the source for a module."""
- pass
-
-
-class NoCode(NoSource):
- """We couldn't find any code at all."""
- pass
-
-
-class NotPython(CoverageException):
- """A source file turned out not to be parsable Python."""
- pass
-
-
-class ExceptionDuringRun(CoverageException):
- """An exception happened while running customer code.
-
- Construct it with three arguments, the values from `sys.exc_info`.
-
- """
- pass
-
-
-class StopEverything(BaseCoverageException):
- """An exception that means everything should stop.
-
- The CoverageTest class converts these to SkipTest, so that when running
- tests, raising this exception will automatically skip the test.
-
- """
- pass