test(gateway): drop source-reading guard test from #71671 salvage
Source-regex tests are banned (AGENTS.md 'Never read source code in tests') — keep only the behavioral regression test.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
hereicq
|
||||
@@ -3,7 +3,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import faulthandler
|
||||
import os
|
||||
import sys
|
||||
|
||||
import pytest
|
||||
@@ -33,15 +32,3 @@ def test_faulthandler_enable_falls_back_when_stderr_is_none(tmp_path):
|
||||
sys.stderr = real_stderr
|
||||
if was_enabled:
|
||||
faulthandler.enable()
|
||||
|
||||
|
||||
def test_gateway_run_keeps_faulthandler_guard():
|
||||
src = os.path.join(
|
||||
os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))),
|
||||
"gateway", "run.py",
|
||||
)
|
||||
with open(src, encoding="utf-8") as f:
|
||||
text = f.read()
|
||||
assert "try:\n faulthandler.enable()\n except (RuntimeError, ValueError, OSError):" in text, (
|
||||
"gateway/run.py must keep the try/except guard around faulthandler.enable() (see #71671)"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user