You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 1, 2024. It is now read-only.
When fixtures are collected, they're stored inside a FixtureRegistry. The FixtureRegistry essentially just wraps a dictionary which maps fixture names to Fixture objects (Dict[str, Fixture]).
The name of a Fixture, and therefore the key used to access it from the FixtureRegistry, is just the name of the function. For example, the fixture below has the name bob:
@fixturedefbob():
return"bob"
A side effect of just using the function name to identify a fixture is that if two fixtures of the same name are collected in a single ward run, the run will fail even if the fixtures are defined in different files (specifically we raise a CollectionError). If we didn't fail the run, the key in the wrapped dict could get overwritten, and we might inject the wrong fixture. Here's where the failure happens:
When fixtures are collected, they're stored inside a
FixtureRegistry
. TheFixtureRegistry
essentially just wraps a dictionary which maps fixture names toFixture
objects (Dict[str, Fixture]
).ward/ward/fixtures.py
Line 71 in 795b918
The name of a
Fixture
, and therefore the key used to access it from theFixtureRegistry
, is just the name of the function. For example, the fixture below has the namebob
:A side effect of just using the function name to identify a fixture is that if two fixtures of the same name are collected in a single
ward
run, the run will fail even if the fixtures are defined in different files (specifically we raise aCollectionError
). If we didn't fail the run, the key in the wrapped dict could get overwritten, and we might inject the wrong fixture. Here's where the failure happens:ward/ward/fixtures.py
Line 84 in 795b918
These are just some of the questions raised by this issue, which will require lots of thought on the most sensible approach.
The text was updated successfully, but these errors were encountered: