Skip to content

Commit 39a9754

Browse files
committed
[test] The test that asserts compatibility with pytest.mark.skip reports success rather than "skipped" when the test succeeds.
Signed-off-by: Michael Seifert <[email protected]>
1 parent a26b6dd commit 39a9754

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

Diff for: tests/test_simple.py

+16-3
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,22 @@ async def test_event_loop_before_fixture(self, event_loop, loop):
265265
assert await loop.run_in_executor(None, self.foo) == 1
266266

267267

268-
@pytest.mark.asyncio
269-
async def test_no_warning_on_skip():
270-
pytest.skip("Test a skip error inside asyncio")
268+
def test_asyncio_marker_compatibility_with_skip(pytester: Pytester):
269+
pytester.makepyfile(
270+
dedent(
271+
"""\
272+
import pytest
273+
274+
pytest_plugins = "pytest_asyncio"
275+
276+
@pytest.mark.asyncio
277+
async def test_no_warning_on_skip():
278+
pytest.skip("Test a skip error inside asyncio")
279+
"""
280+
)
281+
)
282+
result = pytester.runpytest("--asyncio-mode=strict")
283+
result.assert_outcomes(skipped=1)
271284

272285

273286
def test_async_close_loop(event_loop):

0 commit comments

Comments
 (0)