commit 69792368ed6a45c1877360872b751e6077031065 Author: Damian Johnson atagar@torproject.org Date: Thu Oct 29 17:39:55 2020 -0700
Drop test_tools skip function
When we dropped python 2.x support this function became moot. --- stem/util/test_tools.py | 16 ---------------- test/integ/process.py | 6 +++--- 2 files changed, 3 insertions(+), 19 deletions(-)
diff --git a/stem/util/test_tools.py b/stem/util/test_tools.py index ac9f8b88..96aae590 100644 --- a/stem/util/test_tools.py +++ b/stem/util/test_tools.py @@ -96,22 +96,6 @@ def assert_in(expected: Any, actual: Any, msg: Optional[str] = None) -> None: raise AssertionError("Expected '%s' to be within '%s'" % (expected, actual) if msg is None else msg)
-def skip(msg: str) -> None: - """ - Function form of a TestCase's skipTest. - - .. versionadded:: 1.6.0 - - :param msg: reason test is being skipped - - :raises: **unittest.case.SkipTest** for this reason - """ - - # TODO: remove now that python 2.x is unsupported? - - raise unittest.case.SkipTest(msg) - - def asynchronous(func: Callable) -> Callable: test = stem.util.test_tools.AsyncTest(func) ASYNC_TESTS[test.name] = test diff --git a/test/integ/process.py b/test/integ/process.py index d5c7f2f0..6abd9e6a 100644 --- a/test/integ/process.py +++ b/test/integ/process.py @@ -26,7 +26,7 @@ import test.require from contextlib import contextmanager from unittest.mock import patch, Mock
-from stem.util.test_tools import async_test, asynchronous, assert_equal, assert_in, skip +from stem.util.test_tools import async_test, asynchronous, assert_equal, assert_in
BASIC_RELAY_TORRC = """\ SocksPort 9089 @@ -255,7 +255,7 @@ class TestProcess(unittest.TestCase): """
if not stem.util.system.is_available('sleep'): - skip('(sleep unavailable)') + raise unittest.case.SkipTest('(sleep unavailable)')
with patch('re.compile', Mock(side_effect = KeyboardInterrupt('nope'))): # We don't need to actually run tor for this test. Rather, any process will @@ -547,7 +547,7 @@ class TestProcess(unittest.TestCase): """
if not stem.util.system.is_available('sleep'): - skip('(sleep unavailable)') + raise unittest.case.SkipTest('(sleep unavailable)')
with tempfile.TemporaryDirectory() as data_directory: sleep_process = subprocess.Popen(['sleep', '60'])
tor-commits@lists.torproject.org