Skip to content

Commit

Permalink
test: use one variable for pyright
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamilcuk committed Sep 29, 2024
1 parent d9e8634 commit f7d3c6b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@
import re

DIR = Path(__file__).parent.parent
pyright = ["python3", "-m", "pyright"]


def test_typing_check():
assert files, f"{DIR}"


def test_typing():
subprocess.check_call(["pyright"], cwd=DIR)
subprocess.check_call(pyright, cwd=DIR)


typing_tests = DIR / "typing_tests"
files = list(str(x.relative_to(typing_tests)) for x in typing_tests.glob("*.py"))


@pytest.mark.parametrize("filestr", files)
def test_typing_file(filestr: str):
file = Path(typing_tests / filestr)
Expand All @@ -25,7 +28,7 @@ def test_typing_file(filestr: str):
text=True,
).strip()
pp = subprocess.run(
["pyright", str(file.absolute())],
[*pyright, str(file.absolute())],
cwd=file.parent,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
Expand Down

0 comments on commit f7d3c6b

Please sign in to comment.