From 6b7203aba72b86421d7e844334bbdc4caebcd045 Mon Sep 17 00:00:00 2001 From: symonk Date: Sun, 25 Oct 2020 17:38:12 +0000 Subject: [PATCH] add conversion for test_warning_types.py also --- testing/test_warning_types.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/testing/test_warning_types.py b/testing/test_warning_types.py index f16d7252a..46bcee364 100644 --- a/testing/test_warning_types.py +++ b/testing/test_warning_types.py @@ -2,6 +2,7 @@ import inspect import _pytest.warning_types import pytest +from _pytest.pytester import Pytester @pytest.mark.parametrize( @@ -20,11 +21,11 @@ def test_warning_types(warning_class): @pytest.mark.filterwarnings("error::pytest.PytestWarning") -def test_pytest_warnings_repr_integration_test(testdir): +def test_pytest_warnings_repr_integration_test(pytester: Pytester): """Small integration test to ensure our small hack of setting the __module__ attribute of our warnings actually works (#5452). """ - testdir.makepyfile( + pytester.makepyfile( """ import pytest import warnings @@ -33,5 +34,5 @@ def test_pytest_warnings_repr_integration_test(testdir): warnings.warn(pytest.PytestWarning("some warning")) """ ) - result = testdir.runpytest() + result = pytester.runpytest() result.stdout.fnmatch_lines(["E pytest.PytestWarning: some warning"])