Skip to content

test: add random seed in conftest #1958

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all 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
4 changes: 4 additions & 0 deletions binderhub/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import inspect
import json
import os
import random
import secrets
import subprocess
import time
Expand Down Expand Up @@ -64,6 +65,9 @@ def pytest_configure(config):
"helm: mark test to only run when BinderHub is launched with our k8s-binderhub test config.",
)

# add the random seed for reproducibility of tests that uses random
random.seed(42)


def pytest_runtest_setup(item):
is_helm_test = any(mark for mark in item.iter_markers(name="helm"))
Expand Down
Loading