From d697a120ecd1d6eeb7a5a850eb5cce153bf69017 Mon Sep 17 00:00:00 2001 From: Michael Seifert Date: Sat, 21 Oct 2023 10:32:32 +0200 Subject: [PATCH] [refactor] test_warn_asyncio_marker_for_regular_func uses pytester, instead of the older "testdir" fixture. Signed-off-by: Michael Seifert --- tests/test_asyncio_mark_on_sync_function.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/test_asyncio_mark_on_sync_function.py b/tests/test_asyncio_mark_on_sync_function.py index 7de7ec2f..70152b47 100644 --- a/tests/test_asyncio_mark_on_sync_function.py +++ b/tests/test_asyncio_mark_on_sync_function.py @@ -1,8 +1,10 @@ from textwrap import dedent +from pytest import Pytester -def test_warn_asyncio_marker_for_regular_func(testdir): - testdir.makepyfile( + +def test_warn_asyncio_marker_for_regular_func(pytester: Pytester): + pytester.makepyfile( dedent( """\ import pytest @@ -15,7 +17,7 @@ def test_a(): """ ) ) - testdir.makefile( + pytester.makefile( ".ini", pytest=dedent( """\ @@ -26,7 +28,7 @@ def test_a(): """ ), ) - result = testdir.runpytest() + result = pytester.runpytest() result.assert_outcomes(passed=1) result.stdout.fnmatch_lines( ["*is marked with '@pytest.mark.asyncio' but it is not an async function.*"]