From 621b1a73db7567ea6f99905e1aefcafc52cbb29d Mon Sep 17 00:00:00 2001
From: jakkdl
Date: Fri, 2 Jun 2023 15:49:33 +0200
Subject: [PATCH] run mypy with --no-site-packages in export tests
---
trio/_tests/test_exports.py | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
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