From cd4c53a12f136083160c5ec3bdbca073b7348edc Mon Sep 17 00:00:00 2001 From: Stephen Shen Date: Fri, 23 Jan 2026 21:56:55 -0500 Subject: [PATCH 1/2] test: update tests/structures/graphs/conftest.py to add seed in random --- tests/structures/graphs/conftest.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/structures/graphs/conftest.py b/tests/structures/graphs/conftest.py index b7ea29c..d877986 100644 --- a/tests/structures/graphs/conftest.py +++ b/tests/structures/graphs/conftest.py @@ -12,6 +12,11 @@ MAX_WEIGHT = 1000 +def pytest_sessionstart(session): + """Initialize a fixed global random seed for the test session.""" + random.seed(17) + + @pytest.fixture( scope="module", params=[ From f09b26796e7ea8b7536c9791a9cc194c005b17ea Mon Sep 17 00:00:00 2001 From: Stephen Shen Date: Sat, 24 Jan 2026 18:10:25 -0500 Subject: [PATCH 2/2] Fix flake 8 issue --- tests/structures/graphs/conftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/structures/graphs/conftest.py b/tests/structures/graphs/conftest.py index d877986..abcb557 100644 --- a/tests/structures/graphs/conftest.py +++ b/tests/structures/graphs/conftest.py @@ -1,5 +1,5 @@ from math import ceil, sqrt -from random import choices, randint +from random import choices, randint, seed from typing import Any, Dict, List, Set, Tuple, Type, Union import pytest @@ -14,7 +14,7 @@ def pytest_sessionstart(session): """Initialize a fixed global random seed for the test session.""" - random.seed(17) + seed(17) @pytest.fixture(