Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conformance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ To run the conformance test suite:
* Switch to the `conformance` subdirectory and install all dependencies (`pip install -r requirements.txt`).
* Switch to the `src` subdirectory and run `python main.py`.

Note that some type checkers may not run on some platforms. For example, pytype cannot be installed on Windows. If a type checker fails to install, tests will be skipped for that type checker.
Note that some type checkers may not run on some platforms. If a type checker fails to install, tests will be skipped for that type checker.

## Reporting Conformance Results

Expand Down
2 changes: 1 addition & 1 deletion conformance/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ pyright
mypy
pip
pyre-check
pytype; platform_system != "Windows"
pytype
2 changes: 1 addition & 1 deletion conformance/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def f(): pass # E[final]
{"final": [3, 4]}
)
"""
with open(test_case, "r") as f:
with open(test_case, "r", encoding="utf-8") as f:
lines = f.readlines()
output: dict[int, tuple[int, int]] = {}
groups: dict[str, list[int]] = {}
Expand Down
9 changes: 4 additions & 5 deletions conformance/src/type_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"""

from abc import ABC, abstractmethod
from curses.ascii import isspace
import json
from pathlib import Path
import os
Expand Down Expand Up @@ -114,7 +113,7 @@ def run_tests(self, test_files: Sequence[str]) -> dict[str, str]:
"--enable-error-code",
"deprecated",
]
proc = run(command, stdout=PIPE, text=True)
proc = run(command, stdout=PIPE, text=True, encoding="utf-8")
lines = proc.stdout.split("\n")

# Add results to a dictionary keyed by the file name.
Expand Down Expand Up @@ -174,7 +173,7 @@ def get_version(self) -> str:

def run_tests(self, test_files: Sequence[str]) -> dict[str, str]:
command = [sys.executable, "-m", "pyright", ".", "--outputjson"]
proc = run(command, stdout=PIPE, text=True)
proc = run(command, stdout=PIPE, text=True, encoding="utf-8")
output_json = json.loads(proc.stdout)
diagnostics = output_json["generalDiagnostics"]

Expand Down Expand Up @@ -253,7 +252,7 @@ def get_version(self) -> str:
return version

def run_tests(self, test_files: Sequence[str]) -> dict[str, str]:
proc = run(["pyre", "check"], stdout=PIPE, text=True)
proc = run(["pyre", "check"], stdout=PIPE, text=True, encoding="utf-8")
lines = proc.stdout.split("\n")

# Add results to a dictionary keyed by the file name.
Expand Down Expand Up @@ -325,7 +324,7 @@ def run_tests(self, test_files: Sequence[str]) -> dict[str, str]:
if not fi.endswith(".py"):
continue
options.tweak(input=fi)
with open(fi, "r") as test_file:
with open(fi, "r", encoding="utf-8") as test_file:
src = test_file.read()
try:
analysis: pytype_analyze.Analysis = pytype_io.check_py(
Expand Down