Add test coverage

This commit is contained in:
TJ Bruno 2023-01-27 08:27:43 -08:00
parent 6911fcddc7
commit 06cfd00c9a
1 changed files with 21 additions and 0 deletions

View File

@ -496,3 +496,24 @@ def test_nose_setup_skipped_if_non_callable(pytester: Pytester) -> None:
) )
result = pytester.runpytest(p, "-p", "nose") result = pytester.runpytest(p, "-p", "nose")
assert result.ret == 0 assert result.ret == 0
@pytest.mark.parametrize("fixture_name", ("teardown", "teardown_class"))
def test_teardown_fixture_not_called_directly(fixture_name, pytester: Pytester) -> None:
"""Regression test for #10597."""
p = pytester.makepyfile(
f"""
import pytest
class TestHello:
@pytest.fixture
def {fixture_name}(self):
yield
def test_hello(self, {fixture_name}):
assert True
"""
)
result = pytester.runpytest(p, "-p", "nose")
assert result.ret == 0