Remove redundant tests
This commit is contained in:
parent
56e9533354
commit
93e9dafc75
|
@ -135,65 +135,6 @@ def test_fixture_disallowed_between_marks():
|
|||
assert len(record) == 2 # one for each mark decorator
|
||||
|
||||
|
||||
@pytest.mark.filterwarnings("default")
|
||||
def test_nose_deprecated_with_setup(pytester: Pytester) -> None:
|
||||
pytest.importorskip("nose")
|
||||
pytester.makepyfile(
|
||||
"""
|
||||
from nose.tools import with_setup
|
||||
|
||||
def setup_fn_no_op():
|
||||
...
|
||||
|
||||
def teardown_fn_no_op():
|
||||
...
|
||||
|
||||
@with_setup(setup_fn_no_op, teardown_fn_no_op)
|
||||
def test_omits_warnings():
|
||||
...
|
||||
"""
|
||||
)
|
||||
output = pytester.runpytest("-Wdefault::pytest.PytestRemovedIn8Warning")
|
||||
message = [
|
||||
"*PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.",
|
||||
"*test_nose_deprecated_with_setup.py::test_omits_warnings is using nose method: `setup_fn_no_op` (setup)",
|
||||
"*PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.",
|
||||
"*test_nose_deprecated_with_setup.py::test_omits_warnings is using nose method: `teardown_fn_no_op` (teardown)",
|
||||
]
|
||||
output.stdout.fnmatch_lines(message)
|
||||
output.assert_outcomes(passed=1)
|
||||
|
||||
|
||||
@pytest.mark.filterwarnings("default")
|
||||
def test_nose_deprecated_setup_teardown(pytester: Pytester) -> None:
|
||||
pytest.importorskip("nose")
|
||||
pytester.makepyfile(
|
||||
"""
|
||||
class Test:
|
||||
|
||||
def setup(self):
|
||||
...
|
||||
|
||||
def teardown(self):
|
||||
...
|
||||
|
||||
def test(self):
|
||||
...
|
||||
"""
|
||||
)
|
||||
output = pytester.runpytest("-Wdefault::pytest.PytestRemovedIn8Warning")
|
||||
message = [
|
||||
"*PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.",
|
||||
"*test_nose_deprecated_setup_teardown.py::Test::test is using nose-specific method: `setup(self)`",
|
||||
"*To remove this warning, rename it to `setup_method(self)`",
|
||||
"*PytestRemovedIn8Warning: Support for nose tests is deprecated and will be removed in a future release.",
|
||||
"*test_nose_deprecated_setup_teardown.py::Test::test is using nose-specific method: `teardown(self)`",
|
||||
"*To remove this warning, rename it to `teardown_method(self)`",
|
||||
]
|
||||
output.stdout.fnmatch_lines(message)
|
||||
output.assert_outcomes(passed=1)
|
||||
|
||||
|
||||
def test_deprecated_access_to_item_funcargs(pytester: Pytester) -> None:
|
||||
pytester.makepyfile(
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue