@@ -1286,7 +1286,7 @@ def test_3():
1286
1286
result .assert_outcomes (failed = 3 )
1287
1287
1288
1288
1289
- def test_error_on_sync_test_async_fixture (pytester : Pytester ) -> None :
1289
+ def test_warning_on_sync_test_async_fixture (pytester : Pytester ) -> None :
1290
1290
pytester .makepyfile (
1291
1291
test_sync = """
1292
1292
import pytest
@@ -1318,7 +1318,7 @@ def test_foo(async_fixture):
1318
1318
result .assert_outcomes (passed = 1 , warnings = 1 )
1319
1319
1320
1320
1321
- def test_error_on_sync_test_async_fixture_gen (pytester : Pytester ) -> None :
1321
+ def test_warning_on_sync_test_async_fixture_gen (pytester : Pytester ) -> None :
1322
1322
pytester .makepyfile (
1323
1323
test_sync = """
1324
1324
import pytest
@@ -1374,13 +1374,15 @@ def test_foo(async_fixture):
1374
1374
(
1375
1375
"*Sync test 'test_foo' requested async fixture "
1376
1376
"'async_fixture' with autouse=True. "
1377
- "You may want to make the test asynchronous and run it with "
1378
- "a suitable async framework test plugin, or make the fixture synchronous. "
1377
+ "If you intended to use the fixture you may want to make the "
1378
+ "test asynchronous or the fixture synchronous. "
1379
+ "If you did not intend to use it you should "
1380
+ "restructure your test setup. "
1379
1381
"This will turn into an error in pytest 9."
1380
1382
),
1381
1383
]
1382
1384
)
1383
- result .assert_outcomes (passed = 1 )
1385
+ result .assert_outcomes (passed = 1 , warnings = 1 )
1384
1386
1385
1387
1386
1388
def test_pdb_can_be_rewritten (pytester : Pytester ) -> None :
0 commit comments