Skip to content

Commit 8fe16ec

Browse files
committed
Initial migration conversion
1 parent f7af69a commit 8fe16ec

File tree

3 files changed

+100
-84
lines changed

3 files changed

+100
-84
lines changed

conftest.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,21 @@
44
# to fix eventual module import errors that can arise, for example when
55
# running tests from inside VS code.
66
# See https://stackoverflow.com/a/34520971
7+
import json
8+
9+
import numpy as np
10+
import pytest
11+
12+
pytest.RNG = np.random.default_rng()
13+
# pytest.RNG.bit_generator.state = {
14+
# Set RNG state here
15+
# }
16+
17+
18+
def pytest_configure(config):
19+
"""
20+
Called after command line options have been parsed
21+
and all plugins and initial conftest files been loaded.
22+
"""
23+
state = json.dumps(pytest.RNG.bit_generator.state, indent=4)
24+
print(f"conftest.py: pytest.RNG.bit_generator.state = {state}")

test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ check_flake()
8383
check_print()
8484
{
8585
if [[ $print_mode == "verbose" ]]; then
86-
if [[ `grep print */*.py | wc -l` -gt "0" ]]; then
86+
if [[ `grep print --exclude="conftext.py" */*.py | wc -l` -gt "0" ]]; then
8787
echo "Error: print statement found in code"
8888
grep print */*.py
8989
exit 1

0 commit comments

Comments
 (0)