Skip to content

Commit 29357f9

Browse files
committed
update
1 parent b928bf1 commit 29357f9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/tests_fabric/utilities/test_seed.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@ def test_out_of_bounds_seed(seed):
6060
seed_everything(seed)
6161

6262

63+
def test_seed_everything_accepts_valid_seed_argument():
64+
"""Ensure that seed_everything returns the provided valid seed."""
65+
seed_value = 45
66+
assert seed_everything(seed_value) == seed_value
67+
68+
69+
@mock.patch.dict(os.environ, {"PL_GLOBAL_SEED": "17"}, clear=True)
70+
def test_seed_everything_accepts_valid_seed_from_env():
71+
"""Ensure that seed_everything uses the valid seed from the PL_GLOBAL_SEED environment variable."""
72+
assert seed_everything() == 17
73+
74+
6375
def test_reset_seed_no_op():
6476
"""Test that the reset_seed function is a no-op when seed_everything() was not used."""
6577
assert "PL_GLOBAL_SEED" not in os.environ

0 commit comments

Comments
 (0)