diff --git a/tests/typecheck_typeshed.py b/tests/typecheck_typeshed.py index 441e5b273..4a97c342d 100644 --- a/tests/typecheck_typeshed.py +++ b/tests/typecheck_typeshed.py @@ -57,15 +57,18 @@ def run_mypy_as_subprocess(directory: str, platform: str, version: str) -> Retur "--no-error-summary", "--enable-error-code", "ignore-without-code", + "--enable-error-code", + "possibly-undefined", + "--enable-error-code", + "redundant-expr", ] if directory == "tests" and platform == "win32": command.extend(["--exclude", "tests/pytype_test.py"]) - result = subprocess.run(command, capture_output=True) - stdout, stderr = result.stdout, result.stderr - if stderr: - print_error(stderr.decode()) - if stdout: - print_error(stdout.decode()) + result = subprocess.run(command, capture_output=True, text=True) + if result.stderr: + print_error(result.stderr) + if result.stdout: + print_error(result.stdout) return result.returncode