Skip to content

Commit

Permalink
[test] The test that asserts compatibility with pytest.mark.skip repo…
Browse files Browse the repository at this point in the history
…rts success rather than "skipped" when the test succeeds.

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
  • Loading branch information
seifertm committed Jul 12, 2023
1 parent a26b6dd commit 39a9754
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions tests/test_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 39a9754

Please sign in to comment.