Test hygiene: forget the refused study, quiet _Tee on a closed stream, wait for connector recovery

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WgBfkm4rCmtd1T4vHWjEPx
This commit is contained in:
2026-10-14 23:41:31 +02:00
co-authored by Claude Opus 5.5
parent f2305ef619
commit 8e65ce41cb
3 changed files with 37 additions and 10 deletions
+10 -3
View File
@@ -636,6 +636,8 @@ def test_two_files_of_one_name_are_refused(tmp_path) -> None:
where it sits; this is the spelling that still gets there — two files
named on the command line, each rooted at its own directory.
"""
import sys
import pytest
from fluksio.sdk import SyncError
@@ -647,9 +649,14 @@ def test_two_files_of_one_name_are_refused(tmp_path) -> None:
first = tmp_path / "s1" / "study.py"
second = tmp_path / "s2" / "study.py"
_import(*_module_of(first), first)
with pytest.raises(SyncError, match="both import as 'study'"):
_import(*_module_of(second), second)
roots = {str(tmp_path / "s1"), str(tmp_path / "s2")}
try:
_import(*_module_of(first), first)
with pytest.raises(SyncError, match="both import as 'study'"):
_import(*_module_of(second), second)
finally:
sys.modules.pop("study", None)
sys.path[:] = [entry for entry in sys.path if entry not in roots]
def test_how_long_ago_reads_like_a_duration() -> None: