Skip to content

fix compatibility for pytest 8 #20575

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions tests/tests_fabric/utilities/test_seed.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import random
import warnings
from unittest import mock
from unittest.mock import Mock

Expand Down Expand Up @@ -30,9 +31,9 @@ def test_seed_stays_same_with_multiple_seed_everything_calls():
seed_everything()
initial_seed = os.environ.get("PL_GLOBAL_SEED")

with pytest.warns(None) as record:
with warnings.catch_warnings():
warnings.simplefilter("error")
seed_everything()
assert not record # does not warn
seed = os.environ.get("PL_GLOBAL_SEED")

assert initial_seed == seed
Expand Down
Loading