File tree Expand file tree Collapse file tree 2 files changed +38
-35
lines changed Expand file tree Collapse file tree 2 files changed +38
-35
lines changed Original file line number Diff line number Diff line change 1+ from textwrap import dedent
2+
3+ from pytest import Pytester
4+
5+
6+ def test_asyncio_marker_compatibility_with_skip (pytester : Pytester ):
7+ pytester .makepyfile (
8+ dedent (
9+ """\
10+ import pytest
11+
12+ pytest_plugins = "pytest_asyncio"
13+
14+ @pytest.mark.asyncio
15+ async def test_no_warning_on_skip():
16+ pytest.skip("Test a skip error inside asyncio")
17+ """
18+ )
19+ )
20+ result = pytester .runpytest ("--asyncio-mode=strict" )
21+ result .assert_outcomes (skipped = 1 )
22+
23+
24+ def test_asyncio_auto_mode_compatibility_with_skip (pytester : Pytester ):
25+ pytester .makepyfile (
26+ dedent (
27+ """\
28+ import pytest
29+
30+ pytest_plugins = "pytest_asyncio"
31+
32+ async def test_no_warning_on_skip():
33+ pytest.skip("Test a skip error inside asyncio")
34+ """
35+ )
36+ )
37+ result = pytester .runpytest ("--asyncio-mode=auto" )
38+ result .assert_outcomes (skipped = 1 )
Original file line number Diff line number Diff line change @@ -100,41 +100,6 @@ async def test_event_loop_before_fixture(self, loop):
100100 assert await loop .run_in_executor (None , self .foo ) == 1
101101
102102
103- def test_asyncio_marker_compatibility_with_skip (pytester : Pytester ):
104- pytester .makepyfile (
105- dedent (
106- """\
107- import pytest
108-
109- pytest_plugins = "pytest_asyncio"
110-
111- @pytest.mark.asyncio
112- async def test_no_warning_on_skip():
113- pytest.skip("Test a skip error inside asyncio")
114- """
115- )
116- )
117- result = pytester .runpytest ("--asyncio-mode=strict" )
118- result .assert_outcomes (skipped = 1 )
119-
120-
121- def test_asyncio_auto_mode_compatibility_with_skip (pytester : Pytester ):
122- pytester .makepyfile (
123- dedent (
124- """\
125- import pytest
126-
127- pytest_plugins = "pytest_asyncio"
128-
129- async def test_no_warning_on_skip():
130- pytest.skip("Test a skip error inside asyncio")
131- """
132- )
133- )
134- result = pytester .runpytest ("--asyncio-mode=auto" )
135- result .assert_outcomes (skipped = 1 )
136-
137-
138103def test_invalid_asyncio_mode (testdir ):
139104 result = testdir .runpytest ("-o" , "asyncio_mode=True" )
140105 result .stderr .no_fnmatch_line ("INTERNALERROR> *" )
You can’t perform that action at this time.
0 commit comments