mirror of
https://github.com/saphid/frame-control.git
synced 2026-10-06 01:00:18 +02:00
On a maintainer's Mac the compatibility-database key is in the Keychain, so a test that reached install reporting published fake reports. Every test module now imports tests/sandbox.py first, which points app data at a throwaway directory (new FRAME_CONTROL_DATA_DIR), turns telemetry off and sends the database nowhere. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
17 lines
637 B
Python
17 lines
637 B
Python
"""Imported first by every test module: nothing a test does reaches this person's
|
|
app data, their telemetry, or the shared compatibility database.
|
|
|
|
Must run before any ui module is imported, since those read these at import time.
|
|
"""
|
|
import atexit
|
|
import os
|
|
import shutil
|
|
import tempfile
|
|
|
|
_dir = tempfile.mkdtemp(prefix="frame-control-tests-")
|
|
atexit.register(shutil.rmtree, _dir, ignore_errors=True)
|
|
os.environ["FRAME_CONTROL_DATA_DIR"] = _dir
|
|
os.environ["FRAME_CONTROL_TELEMETRY"] = "0"
|
|
# A maintainer's machine holds the database key; send anything that slips through nowhere.
|
|
os.environ["FRAME_COMPAT_DB_URL"] = "http://127.0.0.1:9"
|