diff --git a/trio/_tests/test_exports.py b/trio/_tests/test_exports.py index 4a35a95528..6710a115e1 100644 --- a/trio/_tests/test_exports.py +++ b/trio/_tests/test_exports.py @@ -118,7 +118,16 @@ def no_underscores(symbols): ) from mypy.api import run - res = run(["--config-file=", "--follow-imports=silent", str(tmpfile)]) + res = run( + [ + "--config-file=", + "--follow-imports=silent", + "--no-site-packages", + "--soft-error-limit=-1", + "--no-error-summary", + str(tmpfile), + ] + ) # clean up created py.typed file if not py_typed_exists: # pragma: no cover @@ -294,11 +303,14 @@ def no_hidden(symbols): "--config-file=", "--follow-imports=silent", "--disable-error-code=operator", + "--no-site-packages", "--soft-error-limit=-1", "--no-error-summary", str(tmpfile), ] ) + assert res[2] != 2, f"internal error in mypy {res}" + # no errors if res[2] == 0: continue