From f7d3c6b33b16f84aa923141f9b21b1eef4f11ae3 Mon Sep 17 00:00:00 2001 From: Kamil Cukrowski Date: Sun, 29 Sep 2024 22:38:55 +0200 Subject: [PATCH] test: use one variable for pyright --- tests/test_typing.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test_typing.py b/tests/test_typing.py index dc0cb43..5bc168b 100644 --- a/tests/test_typing.py +++ b/tests/test_typing.py @@ -4,6 +4,7 @@ import re DIR = Path(__file__).parent.parent +pyright = ["python3", "-m", "pyright"] def test_typing_check(): @@ -11,11 +12,13 @@ def test_typing_check(): 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) @@ -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,