test: importing the RTC copy E2E script must not change the environment (credential test isolation)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
gti
2026-09-24 21:23:57 -03:00
co-authored by Claude Sonnet 5
parent 9f08998800
commit 3c10422e81
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -9,10 +9,13 @@ ROOT = Path(__file__).resolve().parents[1]
def _load():
import os
before = dict(os.environ)
sys.path.insert(0, str(ROOT / "scripts")); sys.path.insert(0, str(ROOT / "agent" / "src"))
spec = importlib.util.spec_from_file_location("rtc_copy_write_e2e", ROOT / "scripts" / "rtc_copy_write_e2e.py")
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
assert dict(os.environ) == before, "importing the E2E script must not change the environment"
return module