Skip to content

Commit 087e0b6

Browse files
authored
Show asyncio mode in pytest report headers (#266)
1 parent 308f308 commit 087e0b6

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

README.rst

+1
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ Changelog
261261
- Fixes a bug that prevents async Hypothesis tests from working without explicit ``asyncio`` marker when ``--asyncio-mode=auto`` is set. `#258 <https://github.com/pytest-dev/pytest-asyncio/issues/258>`_
262262
- Fixed a bug that closes the default event loop if the loop doesn't exist `#257 <https://github.com/pytest-dev/pytest-asyncio/issues/257>`_
263263
- Added type annotations. `#198 <https://github.com/pytest-dev/pytest-asyncio/issues/198>`_
264+
- Show asyncio mode in pytest report headers. `#266 <https://github.com/pytest-dev/pytest-asyncio/issues/266>`_
264265

265266
0.17.0 (22-01-13)
266267
~~~~~~~~~~~~~~~~~~~

pytest_asyncio/plugin.py

+7
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,13 @@ def pytest_configure(config: Config) -> None:
187187
config.issue_config_time_warning(LEGACY_MODE, stacklevel=2)
188188

189189

190+
@pytest.mark.tryfirst
191+
def pytest_report_header(config: Config) -> List[str]:
192+
"""Add asyncio config to pytest header."""
193+
mode = _get_asyncio_mode(config)
194+
return [f"asyncio: mode={mode}"]
195+
196+
190197
@pytest.mark.tryfirst
191198
def pytest_pycollect_makeitem(
192199
collector: Union[pytest.Module, pytest.Class], name: str, obj: object

0 commit comments

Comments
 (0)