def test_seed_stays_same_with_multiple_seed_everything_calls():
    """Ensure that after the initial seed everything, the seed stays the same for the same run."""
    with pytest.warns(UserWarning, match="No seed found"):
        seed_everything()
    initial_seed = os.environ.get("PL_GLOBAL_SEED")

    with warnings.catch_warnings():
        warnings.simplefilter("error")
        seed_everything()
    seed = os.environ.get("PL_GLOBAL_SEED")

    assert initial_seed == seed
Ensure that after the initial seed everything, the seed stays the same for the same run.
tests/tests_fabric/utilities/test_seed.py