-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathconftest.py
More file actions
32 lines (23 loc) · 869 Bytes
/
conftest.py
File metadata and controls
32 lines (23 loc) · 869 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
29
30
31
32
from collections.abc import Iterator
from os import environ
from unittest.mock import patch
import pytest
# Ensure that the blueapi entry point is not invoked by doctest as this will fail
collect_ignore = ["src/mx_bluesky/hyperion/blueapi/plans.py"]
environ["HYPERION_TEST_MODE"] = "true"
pytest_plugins = [
"dodal.testing.fixtures.run_engine",
"dodal.testing.fixtures.config_server",
]
def pytest_addoption(parser):
parser.addoption(
"--logging",
action="store_true",
default=False,
help="Log during all tests (not just those that are testing logging logic)",
)
@pytest.fixture(scope="session", autouse=True)
def default_session_fixture() -> Iterator[None]:
print("Patching bluesky 0MQ Publisher in __main__ for the whole session")
with patch("mx_bluesky.hyperion.plan_runner.Publisher"):
yield