Skip to content

Commit

Permalink
[test] Added a test case which verifies compatibility with pytest.mar…
Browse files Browse the repository at this point in the history
…k.xfail in auto mode.

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
  • Loading branch information
seifertm committed Jul 12, 2023
1 parent 7fa36f2 commit a26b6dd
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/test_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,24 @@ async def test_asyncio_marker_fail():
result.assert_outcomes(xfailed=1)


def test_asyncio_auto_mode_compatibility_with_xfail(pytester: Pytester):
pytester.makepyfile(
dedent(
"""\
import pytest
pytest_plugins = "pytest_asyncio"
@pytest.mark.xfail(reason="need a failure", strict=True)
async def test_asyncio_marker_fail():
raise AssertionError
"""
)
)
result = pytester.runpytest("--asyncio-mode=auto")
result.assert_outcomes(xfailed=1)


@pytest.mark.asyncio
async def test_asyncio_marker_with_default_param(a_param=None):
"""Test the asyncio pytest marker."""
Expand Down

0 comments on commit a26b6dd

Please sign in to comment.