From 39a97548bfb0fe0de9527a98563037cb1ce80899 Mon Sep 17 00:00:00 2001 From: Michael Seifert Date: Wed, 12 Jul 2023 11:00:37 +0200 Subject: [PATCH] [test] The test that asserts compatibility with pytest.mark.skip reports success rather than "skipped" when the test succeeds. Signed-off-by: Michael Seifert --- tests/test_simple.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/tests/test_simple.py b/tests/test_simple.py index fd7b7edf..c9853557 100644 --- a/tests/test_simple.py +++ b/tests/test_simple.py @@ -265,9 +265,22 @@ async def test_event_loop_before_fixture(self, event_loop, loop): assert await loop.run_in_executor(None, self.foo) == 1 -@pytest.mark.asyncio -async def test_no_warning_on_skip(): - pytest.skip("Test a skip error inside asyncio") +def test_asyncio_marker_compatibility_with_skip(pytester: Pytester): + pytester.makepyfile( + dedent( + """\ + import pytest + + pytest_plugins = "pytest_asyncio" + + @pytest.mark.asyncio + async def test_no_warning_on_skip(): + pytest.skip("Test a skip error inside asyncio") + """ + ) + ) + result = pytester.runpytest("--asyncio-mode=strict") + result.assert_outcomes(skipped=1) def test_async_close_loop(event_loop):