Skip to content

Commit 0d9e416

Browse files
committed
Include fixture overrides in built devices
1 parent b623cd6 commit 0d9e416

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/dodal/device_manager.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -471,8 +471,6 @@ def build_all(
471471
for f in (self._factories | self._v1_factories).values()
472472
# allow overriding skip but still allow fixtures to override devices
473473
if (include_skipped or not f.skip)
474-
# don't build anything that has been overridden by a fixture
475-
and (not fixtures or f.name not in fixtures)
476474
),
477475
fixtures=fixtures,
478476
mock=mock,
@@ -491,15 +489,14 @@ def build_devices(
491489

492490
fixtures = LazyFixtures(provided=fixtures, factories=self._fixtures)
493491
if common := fixtures.keys() & {f.name for f in factories}:
494-
warnings.warn(
495-
f"Factories ({common}) will be overridden by fixtures", stacklevel=1
496-
)
497492
factories = tuple(f for f in factories if f.name not in common)
498493
build_list = self._expand_dependencies(factories, fixtures)
499494
order = self._build_order(
500495
{dep: self[dep] for dep in build_list}, fixtures=fixtures
501496
)
502-
built: dict[str, AnyDevice] = {}
497+
built: dict[str, AnyDevice] = {
498+
override: fixtures[override] for override in common
499+
}
503500
connection_specs: dict[str, ConnectionSpec] = {}
504501
errors = {}
505502
for device in order:

0 commit comments

Comments
 (0)