summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2021-11-13 19:00:51 -0500
committerNed Batchelder <ned@nedbatchelder.com>2021-11-14 07:44:57 -0500
commit342e7da2941ae5291f1a94b6ad66ce489f6985fe (patch)
tree47dc5f4db2d314c4e0c8051e705222ae76899431 /tests
parentb8eeb82bcc7350aade99844e8730e69120e9bed0 (diff)
downloadpython-coveragepy-git-342e7da2941ae5291f1a94b6ad66ce489f6985fe.tar.gz
docs: document the exceptions
... and make some of them private.
Diffstat (limited to 'tests')
-rw-r--r--tests/conftest.py8
-rw-r--r--tests/test_cmdline.py4
-rw-r--r--tests/test_execfile.py6
3 files changed, 9 insertions, 9 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 16c2c162..6ef42fc1 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -15,7 +15,7 @@ import warnings
import pytest
from coverage import env
-from coverage.exceptions import StopEverything
+from coverage.exceptions import _StopEverything
# Pytest will rewrite assertions in test modules, but not elsewhere.
@@ -96,10 +96,10 @@ def pytest_runtest_call(item):
"""Run once for each test."""
write_test_name(">")
- # Convert StopEverything into skipped tests.
+ # Convert _StopEverything into skipped tests.
outcome = yield
- if outcome.excinfo and issubclass(outcome.excinfo[0], StopEverything): # pragma: only jython
- pytest.skip(f"Skipping {item.nodeid} for StopEverything: {outcome.excinfo[1]}")
+ if outcome.excinfo and issubclass(outcome.excinfo[0], _StopEverything): # pragma: only jython
+ pytest.skip(f"Skipping {item.nodeid} for _StopEverything: {outcome.excinfo[1]}")
write_test_name("<")
diff --git a/tests/test_cmdline.py b/tests/test_cmdline.py
index 4e4f65b0..952dc47b 100644
--- a/tests/test_cmdline.py
+++ b/tests/test_cmdline.py
@@ -16,7 +16,7 @@ import coverage.cmdline
from coverage import env
from coverage.config import CoverageConfig
from coverage.data import CoverageData
-from coverage.exceptions import ExceptionDuringRun
+from coverage.exceptions import _ExceptionDuringRun
from coverage.version import __url__
from tests.coveragetest import CoverageTest, OK, ERR, command_line
@@ -972,7 +972,7 @@ class CmdMainTest(CoverageTest):
try:
raise Exception("oh noes!")
except:
- raise ExceptionDuringRun(*sys.exc_info())
+ raise _ExceptionDuringRun(*sys.exc_info())
elif argv[0] == 'internalraise':
raise ValueError("coverage is broken")
elif argv[0] == 'exit':
diff --git a/tests/test_execfile.py b/tests/test_execfile.py
index d211eba9..9c8b9233 100644
--- a/tests/test_execfile.py
+++ b/tests/test_execfile.py
@@ -15,7 +15,7 @@ import sys
import pytest
from coverage import env
-from coverage.exceptions import NoCode, NoSource, ExceptionDuringRun
+from coverage.exceptions import NoCode, NoSource, _ExceptionDuringRun
from coverage.execfile import run_python_file, run_python_module
from coverage.files import python_reported_file
@@ -185,9 +185,9 @@ class RunFileTest(CoverageTest):
raise RuntimeError('Error Outside')
""")
- with pytest.raises(ExceptionDuringRun) as exc_info:
+ with pytest.raises(_ExceptionDuringRun) as exc_info:
run_python_file(["excepthook_throw.py"])
- # The ExceptionDuringRun exception has the RuntimeError as its argument.
+ # The _ExceptionDuringRun exception has the RuntimeError as its argument.
assert exc_info.value.args[1].args[0] == "Error Outside"
stderr = self.stderr()
assert "in excepthook\n" in stderr