Index: flake8_pyi-23.6.0/tests/test_pyi_files.py =================================================================== --- flake8_pyi-23.6.0.orig/tests/test_pyi_files.py +++ flake8_pyi-23.6.0/tests/test_pyi_files.py @@ -42,16 +42,21 @@ def test_pyi_file(path: str) -> None: option = flag.split("=")[0] assert option != "--ignore", bad_flag_msg + pythonpath = os.environ.get("PYTHONPATH") + pythonpath = f"PYTHONPATH={pythonpath}:." + run_results = [ # Passing a file on command line subprocess.run( - ["flake8", "-j0", *flags, path], + " ".join([pythonpath, "flake8", "-j0", *flags, path]), + shell=True, env={**os.environ, "PYTHONPATH": "."}, stdout=subprocess.PIPE, ), # Passing "-" as the file, and reading from stdin instead subprocess.run( - ["flake8", "-j0", "--stdin-display-name", path, *flags, "-"], + " ".join([pythonpath, "flake8", "-j0", "--stdin-display-name", path, *flags, "-"]), + shell=True, env={**os.environ, "PYTHONPATH": "."}, input=file_contents.encode("utf-8"), stdout=subprocess.PIPE,