Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,21 @@
# to fix eventual module import errors that can arise, for example when
# running tests from inside VS code.
# See https://stackoverflow.com/a/34520971
import json

import numpy as np
import pytest

pytest.RNG = np.random.default_rng()
# pytest.RNG.bit_generator.state = {
# Set RNG state here
# }


def pytest_configure(config):
"""
Called after command line options have been parsed
and all plugins and initial conftest files been loaded.
"""
state = json.dumps(pytest.RNG.bit_generator.state, indent=4)
print(f"conftest.py: pytest.RNG.bit_generator.state = {state}")
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ check_flake()
check_print()
{
if [[ $print_mode == "verbose" ]]; then
if [[ `grep print */*.py | wc -l` -gt "0" ]]; then
if [[ `grep print --exclude="conftext.py" */*.py | wc -l` -gt "0" ]]; then
Comment thread
NimaSarajpoor marked this conversation as resolved.
Outdated
echo "Error: print statement found in code"
grep print */*.py
exit 1
Expand Down
Loading