Skip to content

Commit

Permalink
Explicitly mark tango tests with forked
Browse files Browse the repository at this point in the history
  • Loading branch information
jsouter committed Dec 4, 2024
1 parent e7e36f8 commit d83a7eb
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 70 deletions.
15 changes: 0 additions & 15 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,18 +244,3 @@ def one_shot_trigger_info() -> TriggerInfo:
deadtime=None,
livetime=None,
)


def pytest_collection_modifyitems(config, items):
tango_dir = "tests/tango"

for item in items:
if tango_dir in str(item.fspath):
if sys.version_info >= (3, 12):
item.add_marker(
pytest.mark.skip(
reason="Tango is currently not supported on Python 3.12: https://github.com/bluesky/ophyd-async/issues/681"
)
)
else:
item.add_marker(pytest.mark.forked)
10 changes: 5 additions & 5 deletions tests/tango/test_base_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def compare_values(expected, received):


# --------------------------------------------------------------------
@pytest.mark.asyncio
@pytest.mark.forked
async def test_connect(tango_test_device):
values, description = await describe_class(tango_test_device)

Expand All @@ -311,7 +311,7 @@ async def test_connect(tango_test_device):


# --------------------------------------------------------------------
@pytest.mark.asyncio
@pytest.mark.forked
async def test_set_trl(tango_test_device):
values, description = await describe_class(tango_test_device)
test_device = TestTangoReadable(name="test_device")
Expand All @@ -325,7 +325,7 @@ async def test_set_trl(tango_test_device):


# --------------------------------------------------------------------
@pytest.mark.asyncio
@pytest.mark.forked
@pytest.mark.parametrize("proxy", [True, False, None])
async def test_connect_proxy(tango_test_device, proxy: bool | None):
if proxy is None:
Expand All @@ -345,7 +345,7 @@ async def test_connect_proxy(tango_test_device, proxy: bool | None):


# --------------------------------------------------------------------
@pytest.mark.asyncio
@pytest.mark.forked
async def test_with_bluesky(tango_test_device):
# now let's do some bluesky stuff
RE = RunEngine()
Expand All @@ -355,7 +355,7 @@ async def test_with_bluesky(tango_test_device):


# --------------------------------------------------------------------
@pytest.mark.asyncio
@pytest.mark.forked
async def test_tango_demo(demo_test_context):
with demo_test_context:
detector = TangoDetector(
Expand Down
20 changes: 10 additions & 10 deletions tests/tango/test_tango_signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ async def assert_monitor_then_put(


# --------------------------------------------------------------------
@pytest.mark.asyncio
@pytest.mark.forked
async def test_backend_get_put_monitor_attr(echo_device: str):
try:
for attr_data in ATTRIBUTES_SET:
Expand Down Expand Up @@ -383,7 +383,7 @@ async def assert_put_read(


# --------------------------------------------------------------------
@pytest.mark.asyncio
@pytest.mark.forked
async def test_backend_get_put_monitor_cmd(
echo_device: str,
):
Expand All @@ -401,7 +401,7 @@ async def test_backend_get_put_monitor_cmd(


# --------------------------------------------------------------------
@pytest.mark.asyncio
@pytest.mark.forked
async def test_tango_signal_r(
echo_device: str,
):
Expand All @@ -424,7 +424,7 @@ async def test_tango_signal_r(


# --------------------------------------------------------------------
@pytest.mark.asyncio
@pytest.mark.forked
async def test_tango_signal_w(
echo_device: str,
):
Expand Down Expand Up @@ -461,7 +461,7 @@ async def test_tango_signal_w(


# --------------------------------------------------------------------
@pytest.mark.asyncio
@pytest.mark.forked
async def test_tango_signal_rw(
echo_device: str,
):
Expand Down Expand Up @@ -490,7 +490,7 @@ async def test_tango_signal_rw(


# --------------------------------------------------------------------
@pytest.mark.asyncio
@pytest.mark.forked
async def test_tango_signal_x(tango_test_device: str):
timeout = 0.2
for use_proxy in [True, False]:
Expand All @@ -508,7 +508,7 @@ async def test_tango_signal_x(tango_test_device: str):


# --------------------------------------------------------------------
@pytest.mark.asyncio
@pytest.mark.forked
@pytest.mark.skip("Not sure if we need tango_signal_auto")
async def test_tango_signal_auto_attrs(
echo_device: str,
Expand Down Expand Up @@ -553,7 +553,7 @@ async def _test_signal(dtype, proxy, source, initial_value, put_value):


# --------------------------------------------------------------------
@pytest.mark.asyncio
@pytest.mark.forked
@pytest.mark.skip("Not sure if we need tango_signal_auto")
@pytest.mark.parametrize(
"use_dtype, use_proxy",
Expand Down Expand Up @@ -601,7 +601,7 @@ async def _test_signal(dtype, proxy, source, put_value):


# --------------------------------------------------------------------
@pytest.mark.asyncio
@pytest.mark.forked
@pytest.mark.skip("Not sure if we need tango_signal_auto")
async def test_tango_signal_auto_cmds_void(tango_test_device: str, use_proxy: bool):
for use_proxy in [True, False]:
Expand All @@ -618,7 +618,7 @@ async def test_tango_signal_auto_cmds_void(tango_test_device: str, use_proxy: bo


# --------------------------------------------------------------------
@pytest.mark.asyncio
@pytest.mark.forked
@pytest.mark.skip("Not sure if we need tango_signal_auto")
async def test_tango_signal_auto_badtrl(tango_test_device: str):
proxy = await DeviceProxy(tango_test_device)
Expand Down
Loading

0 comments on commit d83a7eb

Please sign in to comment.