diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2021-03-11 15:25:11 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2021-03-11 15:25:11 -0500 |
commit | 1bdcc691f5127edf9f197f8b509a2eeff51edcd6 (patch) | |
tree | 60fdc179154ae813e53abc0493b9b01eb9e933ab /tests/test_testing.py | |
parent | d2985974a0fba46df7552a9958c7f9ef34f75868 (diff) | |
download | python-coveragepy-git-nedbat/remove-unittest-testcase.tar.gz |
test: simplify how StopEverything is converted to skipnedbat/remove-unittest-testcase
The auto-decorating metaclass was interfering with parameterized methods
on Python 2.7. But we don't need it anymore anyway, since pytest will
let us hook to deal with the exception in a simpler way.
Diffstat (limited to 'tests/test_testing.py')
-rw-r--r-- | tests/test_testing.py | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/tests/test_testing.py b/tests/test_testing.py index ad26bada..558c846e 100644 --- a/tests/test_testing.py +++ b/tests/test_testing.py @@ -14,14 +14,12 @@ import pytest import coverage from coverage import tomlconfig from coverage.files import actual_path -from coverage.misc import StopEverything from tests.coveragetest import CoverageTest from tests.helpers import ( arcs_to_arcz_repr, arcz_to_arcs, assert_count_equal, CheckUniqueFilenames, re_lines, re_line, without_module, ) -from tests.mixins import convert_skip_exceptions def test_xdist_sys_path_nuttiness_is_fixed(): @@ -320,33 +318,6 @@ class ReLinesTest(CoverageTest): re_line(text, pat) -def test_convert_skip_exceptions(): - # pytest doesn't expose the exception raised by pytest.skip, so let's - # make one to get the class. - try: - pytest.skip("Just to get the exception") - except BaseException as exc: - pytest_Skipped = type(exc) - - @convert_skip_exceptions - def some_method(ret=None, exc=None): - """Be like a test case.""" - if exc: - raise exc("yikes!") - return ret - - # Normal flow is normal. - assert some_method(ret=[17, 23]) == [17, 23] - - # Exceptions are raised normally. - with pytest.raises(ValueError): - some_method(exc=ValueError) - - # But a StopEverything becomes a skip. - with pytest.raises(pytest_Skipped): - some_method(exc=StopEverything) - - def _same_python_executable(e1, e2): """Determine if `e1` and `e2` refer to the same Python executable. |