Skip to content

Commit

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

Signed-off-by: Michael Seifert <m.seifert@digitalernachschub.de>
  • Loading branch information
seifertm committed Jul 12, 2023
1 parent 39a9754 commit 79b2d1a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/source/reference/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Changelog
- Output a proper error message when an invalid ``asyncio_mode`` is selected.
- Extend warning message about unclosed event loops with additional possible cause.
`#531 <https://github.com/pytest-dev/pytest-asyncio/issues/531>`_
- Previously, some tests reported "skipped" or "xfailed" as a result. Now all tests report a "success" results.

0.21.0 (2023-03-19)
===================
Expand Down
17 changes: 17 additions & 0 deletions tests/test_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,23 @@ async def test_no_warning_on_skip():
result.assert_outcomes(skipped=1)


def test_asyncio_auto_mode_compatibility_with_skip(pytester: Pytester):
pytester.makepyfile(
dedent(
"""\
import pytest
pytest_plugins = "pytest_asyncio"
async def test_no_warning_on_skip():
pytest.skip("Test a skip error inside asyncio")
"""
)
)
result = pytester.runpytest("--asyncio-mode=auto")
result.assert_outcomes(skipped=1)


def test_async_close_loop(event_loop):
event_loop.close()

Expand Down

0 comments on commit 79b2d1a

Please sign in to comment.