Skip to content

Commit 54d2c6a

Browse files
committed
add test helper module from cookiecutter
1 parent 1397b01 commit 54d2c6a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

probscale/tests/helpers.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from functools import wraps
2+
3+
import numpy
4+
5+
6+
def seed(func):
7+
""" Decorator to seed the RNG before any function. """
8+
@wraps(func)
9+
def wrapper(*args, **kwargs):
10+
numpy.random.seed(0)
11+
return func(*args, **kwargs)
12+
return wrapper

0 commit comments

Comments
 (0)