|
1 | 1 | from __future__ import annotations |
2 | 2 |
|
| 3 | +import sys |
3 | 4 | from textwrap import dedent |
4 | 5 |
|
5 | 6 | from pytest import Pytester |
@@ -87,8 +88,15 @@ async def test_does_not_use_custom_event_loop_policy(): |
87 | 88 | """ |
88 | 89 | ), |
89 | 90 | ) |
90 | | - result = pytester.runpytest("--asyncio-mode=strict") |
91 | | - result.assert_outcomes(passed=2) |
| 91 | + pytest_args = ["--asyncio-mode=strict"] |
| 92 | + if sys.version_info >= (3, 14): |
| 93 | + pytest_args.extend(["-W", "default"]) |
| 94 | + result = pytester.runpytest(*pytest_args) |
| 95 | + if sys.version_info >= (3, 14): |
| 96 | + result.assert_outcomes(passed=2, warnings=3) |
| 97 | + result.stdout.fnmatch_lines("*DefaultEventLoopPolicy*") |
| 98 | + else: |
| 99 | + result.assert_outcomes(passed=2) |
92 | 100 |
|
93 | 101 |
|
94 | 102 | def test_asyncio_mark_respects_parametrized_loop_policies( |
@@ -119,8 +127,15 @@ async def test_parametrized_loop(): |
119 | 127 | """ |
120 | 128 | ) |
121 | 129 | ) |
122 | | - result = pytester.runpytest("--asyncio-mode=strict") |
123 | | - result.assert_outcomes(passed=2) |
| 130 | + pytest_args = ["--asyncio-mode=strict"] |
| 131 | + if sys.version_info >= (3, 14): |
| 132 | + pytest_args.extend(["-W", "default"]) |
| 133 | + result = pytester.runpytest(*pytest_args) |
| 134 | + if sys.version_info >= (3, 14): |
| 135 | + result.assert_outcomes(passed=2, warnings=2) |
| 136 | + result.stdout.fnmatch_lines("*DefaultEventLoopPolicy*") |
| 137 | + else: |
| 138 | + result.assert_outcomes(passed=2) |
124 | 139 |
|
125 | 140 |
|
126 | 141 | def test_asyncio_mark_provides_module_scoped_loop_to_fixtures( |
|
0 commit comments