Skip to content

Commit 27c8886

Browse files
authored
Enable --no-silence-site-packages in eval tests (#5370)
An unintended side-effect of silencing errors in site packages and typeshed by default is that our tests no longer flag changes to mypy that end up breaking typeshed in some way. (For example, see https://github.com/python/mypy/pulls/5280 which *really* should not be passing, at least as of time of writing.) This pull request will add the `--no-silence-site-packages` flag to any test suites that directly or indirectly test typeshed. Specifically, I believe this PR ought to add the flag to any tests triggered by `testsamples.py`, `testselfcheck.py`, and `testpythoneval.py`.
1 parent 0a26230 commit 27c8886

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

mypy/test/helpers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
def run_mypy(args: List[str]) -> None:
3333
__tracebackhide__ = True
3434
outval, errval, status = api.run(args + ['--show-traceback',
35-
'--no-site-packages'])
35+
'--no-site-packages',
36+
'--no-silence-site-packages'])
3637
if status != 0:
3738
sys.stdout.write(outval)
3839
sys.stderr.write(errval)

mypy/test/testpythoneval.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ def test_python_evaluation(testcase: DataDrivenTestCase, cache_dir: str) -> None
5050
"""
5151
assert testcase.old_cwd is not None, "test was not properly set up"
5252
# TODO: Enable strict optional for these tests
53-
mypy_cmdline = ['--show-traceback', '--no-site-packages', '--no-strict-optional']
53+
mypy_cmdline = [
54+
'--show-traceback',
55+
'--no-site-packages',
56+
'--no-strict-optional',
57+
'--no-silence-site-packages',
58+
]
5459
py2 = testcase.name.lower().endswith('python2')
5560
if py2:
5661
mypy_cmdline.append('--py2')

0 commit comments

Comments
 (0)