From 253f927c0a45c4830c54f2fd99163e8191f9b6b3 Mon Sep 17 00:00:00 2001 From: Alex Stokes Date: Sun, 22 Aug 2021 12:14:17 -0700 Subject: [PATCH] fix randomness seed across randomized test --- .../pyspec/eth2spec/test/phase0/sanity/test_blocks_random.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/core/pyspec/eth2spec/test/phase0/sanity/test_blocks_random.py b/tests/core/pyspec/eth2spec/test/phase0/sanity/test_blocks_random.py index 93f31a4da..8928b9309 100644 --- a/tests/core/pyspec/eth2spec/test/phase0/sanity/test_blocks_random.py +++ b/tests/core/pyspec/eth2spec/test/phase0/sanity/test_blocks_random.py @@ -1,6 +1,6 @@ import itertools import warnings -from random import Random +import random from tests.core.pyspec.eth2spec.test.helpers.constants import PHASE0, ALTAIR from typing import Callable from tests.core.pyspec.eth2spec.test.context import ( @@ -276,7 +276,7 @@ def _generate_randomized_scenarios(): NOTE: the main block driver builds a block for the **next** slot, so the slot transitions are offset by -1 to target certain boundaries. """ - rng = Random(1336) + rng = random.Random(1336) # go forward 0 or 1 epochs epochs_set = ( @@ -377,6 +377,7 @@ def _iter_temporal(spec, callable_or_int): @single_phase @always_bls def test_harness_for_randomized_blocks(spec, state, test_description): + random.seed(1337) for mutation, validation in test_description["setup"]: mutation(spec, state) validation(spec, state)