Skip to content

Commit 56a50ca

Browse files
committed
Move ReachableCode exception to test.support
1 parent 9b14083 commit 56a50ca

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

Lib/test/support/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
# globals
2424
"PIPE_MAX_SIZE", "verbose", "max_memuse", "use_resources", "failfast",
2525
# exceptions
26-
"Error", "TestFailed", "TestDidNotRun", "ResourceDenied",
26+
"ReachableCode", "Error", "TestFailed", "TestDidNotRun", "ResourceDenied",
2727
# io
2828
"record_original_stdout", "get_original_stdout", "captured_stdout",
2929
"captured_stdin", "captured_stderr", "captured_output",
@@ -107,6 +107,11 @@
107107
STDLIB_DIR = os.path.dirname(TEST_HOME_DIR)
108108
REPO_ROOT = os.path.dirname(STDLIB_DIR)
109109

110+
class ReachableCode(Exception):
111+
"""Exception to raise to indicate that some code was reached.
112+
113+
Use this exception if using mocks is not a good alternative.
114+
"""
110115

111116
class Error(Exception):
112117
"""Base class for regression test exceptions."""

Lib/test/test_asyncio/test_futures.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import warnings
1515
from test.test_asyncio import utils as test_utils
1616
from test import support
17+
from test.support import ReachableCode
1718

1819

1920
def tearDownModule():
@@ -32,13 +33,6 @@ def last_cb():
3233
pass
3334

3435

35-
class ReachableCode(Exception):
36-
"""Exception to raise to indicate that some code was reached.
37-
38-
Use this exception if using mocks is not a good alternative.
39-
"""
40-
41-
4236
class SimpleEvilEventLoop(asyncio.base_events.BaseEventLoop):
4337
"""Base class for UAF and other evil stuff requiring an evil event loop."""
4438

0 commit comments

Comments
 (0)