File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change 3
3
from textwrap import dedent
4
4
5
5
import pytest
6
+ from pytest import Pytester
6
7
7
8
import pytest_asyncio .plugin
8
9
@@ -25,10 +26,23 @@ async def test_asyncio_marker():
25
26
await asyncio .sleep (0 )
26
27
27
28
28
- @pytest .mark .xfail (reason = "need a failure" , strict = True )
29
- @pytest .mark .asyncio
30
- async def test_asyncio_marker_fail ():
31
- raise AssertionError
29
+ def test_asyncio_marker_compatibility_with_xfail (pytester : Pytester ):
30
+ pytester .makepyfile (
31
+ dedent (
32
+ """\
33
+ import pytest
34
+
35
+ pytest_plugins = "pytest_asyncio"
36
+
37
+ @pytest.mark.xfail(reason="need a failure", strict=True)
38
+ @pytest.mark.asyncio
39
+ async def test_asyncio_marker_fail():
40
+ raise AssertionError
41
+ """
42
+ )
43
+ )
44
+ result = pytester .runpytest ("--asyncio-mode=strict" )
45
+ result .assert_outcomes (xfailed = 1 )
32
46
33
47
34
48
@pytest .mark .asyncio
You can’t perform that action at this time.
0 commit comments