-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathconftest.py
More file actions
28 lines (21 loc) · 707 Bytes
/
Copy pathconftest.py
File metadata and controls
28 lines (21 loc) · 707 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# content of conftest.py
import pytest
import asyncio
def pytest_addoption(parser):
parser.addoption(
"--e2e", action="store_true", default=False, help="run e2e e2e_tests"
)
def pytest_collection_modifyitems(config, items):
if config.getoption("--e2e"):
# --e2e given in cli: do not skip e2e e2e_tests
return
skip_e2e = pytest.mark.skip(reason="need --e2e option to run")
for item in items:
if "e2e" in item.keywords:
item.add_marker(skip_e2e)
# override the scope of the event loop, by default it is function scoped
@pytest.fixture(scope="session")
def event_loop():
loop = asyncio.get_event_loop()
yield loop
loop.close()