diff --git a/tests/unit_tests/core/fake_plan_module.py b/tests/unit_tests/core/fake_plan_module.py index 3125993ab..e5ff50ec2 100644 --- a/tests/unit_tests/core/fake_plan_module.py +++ b/tests/unit_tests/core/fake_plan_module.py @@ -1,5 +1,6 @@ from collections.abc import Generator from typing import Any, TypeVar +from typing import Generator as DeprecatedGenerator # noqa: UP035 from bluesky.utils import Msg, MsgGenerator @@ -15,6 +16,8 @@ def plan_d(d: int) -> Generator[Msg, None, Any]: ... def plan_e(e: str) -> Generator[Msg, int, Any]: ... def plan_f(f: bool) -> PlanReturningStr: ... def plan_g(g: T) -> MsgGenerator[T]: ... +def plan_h(h: int) -> DeprecatedGenerator[Msg, None, Any]: ... +def plan_i(i: str) -> DeprecatedGenerator[Msg, int, Any]: ... # Not plans diff --git a/tests/unit_tests/core/test_context.py b/tests/unit_tests/core/test_context.py index 61914dfd8..4f70204d9 100644 --- a/tests/unit_tests/core/test_context.py +++ b/tests/unit_tests/core/test_context.py @@ -18,6 +18,17 @@ SIM_MOTOR_NAME = "sim" ALT_MOTOR_NAME = "alt" SIM_DET_NAME = "sim_det" +EXPECTED_PLANS = { + "plan_a", + "plan_b", + "plan_c", + "plan_d", + "plan_e", + "plan_f", + "plan_g", + "plan_h", + "plan_i", +} # @@ -151,15 +162,7 @@ def test_add_plan_from_module(empty_context: BlueskyContext) -> None: import tests.unit_tests.core.fake_plan_module as plan_module empty_context.with_plan_module(plan_module) - assert { - "plan_a", - "plan_b", - "plan_c", - "plan_d", - "plan_e", - "plan_f", - "plan_g", - } == empty_context.plans.keys() + assert EXPECTED_PLANS == empty_context.plans.keys() def test_add_named_device(empty_context: BlueskyContext, sim_motor: SynAxis) -> None: @@ -295,15 +298,7 @@ def test_add_devices_and_plans_from_modules_with_config( "ophyd_device", "ophyd_async_device", } == empty_context.devices.keys() - assert { - "plan_a", - "plan_b", - "plan_c", - "plan_d", - "plan_e", - "plan_f", - "plan_g", - } == empty_context.plans.keys() + assert EXPECTED_PLANS == empty_context.plans.keys() def test_function_spec(empty_context: BlueskyContext) -> None: