-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d4352f
commit 0b584be
Showing
8 changed files
with
82 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# name: test_typing | ||
<class 'list'> [ | ||
<class 'dict'> { | ||
'message': ' | ||
No overloads for "function_decorator" match the provided arguments | ||
Argument types: (Literal[True]) | ||
', | ||
'range': <class 'dict'> { | ||
'end': <class 'dict'> { | ||
'character': 47, | ||
'line': 10, | ||
}, | ||
'start': <class 'dict'> { | ||
'character': 9, | ||
'line': 10, | ||
}, | ||
}, | ||
'rule': 'reportGeneralTypeIssues', | ||
'severity': 'error', | ||
}, | ||
<class 'dict'> { | ||
'message': ' | ||
Argument of type "Literal[2]" cannot be assigned to parameter "scope" of type "str" in function "__call__" | ||
"Literal[2]" is incompatible with "str" | ||
', | ||
'range': <class 'dict'> { | ||
'end': <class 'dict'> { | ||
'character': 26, | ||
'line': 30, | ||
}, | ||
'start': <class 'dict'> { | ||
'character': 25, | ||
'line': 30, | ||
}, | ||
}, | ||
'rule': 'reportGeneralTypeIssues', | ||
'severity': 'error', | ||
}, | ||
] | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import json | ||
import subprocess | ||
|
||
|
||
def run_pyright(filename): | ||
result = subprocess.run( | ||
["pyright", "--outputjson", filename], | ||
capture_output=True, | ||
text=True, | ||
) | ||
assert result.stdout, result.stderr | ||
output = json.loads(result.stdout) | ||
|
||
def clean_row(data): | ||
del data["file"] | ||
return data | ||
|
||
return [clean_row(row) for row in output["generalDiagnostics"]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import pytest | ||
import sys | ||
from .base import run_pyright | ||
|
||
|
||
@pytest.mark.skipif( | ||
sys.version_info < (3, 7), | ||
reason="Requires Python 3.7+", | ||
) | ||
def test_typing(snapshot): | ||
actual = run_pyright("tests/pyright/test_file.py") | ||
assert actual == snapshot |