Skip to content

Ensure that unique (now once) fixture are actually not shared#41

Merged
mgautierfr merged 7 commits into
mainfrom
unique_is_unique
May 30, 2025
Merged

Ensure that unique (now once) fixture are actually not shared#41
mgautierfr merged 7 commits into
mainfrom
unique_is_unique

Conversation

@mgautierfr
Copy link
Copy Markdown
Owner

Last introduction of two step fixture building was introducing a bug where unique fixture was actually shared across test/fixture's matrix.

This PR:

  • Rename Unique scope to Once.
  • Do not sharing at all unique(once) proxy.
  • Introduce MatrixUnique scope (equivalent to what was Unique scope)
  • Fix Tempfile and global fixture.
  • Properly test scopes.

Nothing else to do. A MatrixScope fixture is a fixture with a shared state
(through `Duplicate`) not stored in the cache.
`Unique` was error prone as user (and myself) may think that the fixture
was unique, and so created only once.

Hope that `once` will be better.
Unique fixture must not share a state.
As unique scope fixtures do not share a state, we have to introduce a
shared state in `Global` fixture.
@mgautierfr mgautierfr merged commit 5eaf1ee into main May 30, 2025
9 checks passed
@mgautierfr mgautierfr deleted the unique_is_unique branch May 30, 2025 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant