初始化奇妙小屏幕控制器项目

This commit is contained in:
2026-09-08 22:56:52 +08:00
commit 8d368de3b5
491 changed files with 67678 additions and 0 deletions
@@ -0,0 +1,23 @@
from __future__ import annotations
import os
from pathlib import Path
import tempfile
import pytest
@pytest.mark.skipif(
os.environ.get("MATRIX_LEGACY_ISOLATION_PROBE") != "1",
reason="only executed by the isolated legacy-worker compatibility test",
)
def test_legacy_worker_paths_are_transaction_scoped(tmp_path):
root = Path(os.environ["MATRIX_TEST_ROOT"]).resolve()
assert Path(os.environ["MATRIX_DATA_DIR"]).resolve().is_relative_to(root)
assert Path(os.environ["MATRIX_RUNTIME_DIR"]).resolve().is_relative_to(root)
assert Path(tempfile.gettempdir()).resolve().is_relative_to(root)
assert tmp_path.resolve().is_relative_to(root)
with tempfile.NamedTemporaryFile() as handle:
assert Path(handle.name).resolve().is_relative_to(root)
if os.environ.get("MATRIX_STRICT_PYTEST_FAILURE_PROBE") == "1":
pytest.fail("strict legacy-worker pytest probe executed")