Skip to content

Commit

Permalink
Print stderr of failed pyright run
Browse files Browse the repository at this point in the history
  • Loading branch information
dkang-quora committed Feb 21, 2025
1 parent f247b6a commit 1136192
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions asynq/tests/test_pyright.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@ def _run_pyright(path) -> List[Dict[str, Any]]:
p = subprocess.run(
["pyright", "--outputjson", path], text=True, capture_output=True
)
diagnostics = json.loads(p.stdout.replace("\xa0", " ")).get(
"generalDiagnostics", []
)
try:
diagnostics = json.loads(p.stdout.replace("\xa0", " ")).get(
"generalDiagnostics", []
)
except Exception as e:
raise RuntimeError(p.stderr) from e

return [
{"message": d["message"], "rule": d["rule"], "range": d["range"]}
for d in diagnostics
Expand Down

0 comments on commit 1136192

Please sign in to comment.