userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
plugin.py
1
import
pytest
2
3
4
@pytest.hookimpl(tryfirst=True)
5
def
pytest_configure(config):
6
# Force default asyncio mode
7
config.option.asyncio_mode =
'auto'
8
# Force fixtures to use session loop
9
config._inicache[
'asyncio_default_fixture_loop_scope'
] =
'session'
10
11
12
def
pytest_collection_modifyitems(items):
13
"""Force tests to use session asyncio loop."""
14
for
item
in
items:
15
mark = item.get_closest_marker(
'asyncio'
)
16
if
mark:
17
mark.kwargs.setdefault(
'loop_scope'
,
'session'
)
en
testsuite
plugins
asyncio
plugin.py
Generated on
for userver by
Doxygen
1.17.0