Skip to content

chore(tests): add set_seed pytest fixture for determinism#43829

Closed
jayzuccarelli wants to merge 2 commits intohuggingface:mainfrom
jayzuccarelli:chore/add-set-seed-pytest-fixture
Closed

chore(tests): add set_seed pytest fixture for determinism#43829
jayzuccarelli wants to merge 2 commits intohuggingface:mainfrom
jayzuccarelli:chore/add-set-seed-pytest-fixture

Conversation

@jayzuccarelli
Copy link
Copy Markdown

Fixes #43805

Follow-up to #43794: add a pytest fixture that sets a fixed seed (42) before each test so we always get the same RNG state in model tests and improve determinism.

  • tests/conftest.py (new): set_seed fixture with autouse=True and scope="function", calling set_seed(42) so every test runs with a fixed seed without changing individual tests.

No changes to existing tests; the fixture runs automatically.

@jayzuccarelli jayzuccarelli deleted the chore/add-set-seed-pytest-fixture branch February 10, 2026 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(test): add a set_seed pytest fixture

2 participants