Ejemplo n.º 1
0
def test_invalid_seeds():
    for seed in [-1, 'test']:
        try:
            seeding.np_random(seed)
        except error.Error:
            pass
        else:
            assert False, 'Invalid seed {} passed validation'.format(seed)
Ejemplo n.º 2
0
 def seed(self, seed=None):
     self.np_random, seed = seeding.np_random(seed)
     return [seed]
Ejemplo n.º 3
0
def test_valid_seeds():
    for seed in [0, 1]:
        random, seed1 = seeding.np_random(seed)
        assert seed == seed1