From 34c60bdf098b467f3aa9664bc954abc8c226c876 Mon Sep 17 00:00:00 2001 From: Rod Boev Date: Mon, 24 Aug 2026 11:28:56 -0400 Subject: [PATCH] test(updates): avoid conftest module identity assumptions (#7195) --- tests/test_issue7195_windows_restart.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/test_issue7195_windows_restart.py b/tests/test_issue7195_windows_restart.py index 80004f42..8972ab99 100644 --- a/tests/test_issue7195_windows_restart.py +++ b/tests/test_issue7195_windows_restart.py @@ -126,20 +126,16 @@ def test_windows_spawn_failure_keeps_current_process(monkeypatch, caplog): def test_pytest_session_restart_operations_are_inert(): - import tests.conftest as conftest - - assert updates._windows_restart_spawn is conftest._pytest_session_safe_windows_restart_spawn - assert updates._windows_restart_exit is conftest._pytest_session_safe_windows_restart_exit + assert updates._windows_restart_spawn(None) is None + assert updates._windows_restart_exit(0) is None def test_local_restart_recorders_restore_session_guards(monkeypatch): - import tests.conftest as conftest - monkeypatch.setattr(updates, "_windows_restart_spawn", lambda *_args, **_kwargs: None) monkeypatch.setattr(updates, "_windows_restart_exit", lambda *_args: None) monkeypatch.undo() - assert updates._windows_restart_spawn is conftest._pytest_session_safe_windows_restart_spawn - assert updates._windows_restart_exit is conftest._pytest_session_safe_windows_restart_exit + assert updates._windows_restart_spawn(None) is None + assert updates._windows_restart_exit(0) is None @pytest.mark.parametrize("frozen", [False, True])