python-flake8-pyi/set-tests-python-path.patch
Dirk Mueller 94197e409a - update to 24.9.0:
* Don't emit Y053 for long strings inside `Literal` slices or
  * metadata strings inside `Annotated` slices.
  * `flake8-pyi` no longer supports being run using Python 3.8.
    As a result, it not longer depends on the third-party
   `ast_decompiler` package.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-flake8-pyi?expand=0&rev=33
2024-10-29 21:16:10 +00:00

24 lines
953 B
Diff

Index: flake8_pyi-23.11.0/tests/test_pyi_files.py
===================================================================
--- flake8_pyi-23.11.0.orig/tests/test_pyi_files.py
+++ flake8_pyi-23.11.0/tests/test_pyi_files.py
@@ -43,6 +43,9 @@ def test_pyi_file(path: str) -> None:
option = flag.split("=")[0]
assert option not in {"--ignore", "--select"}, bad_flag_msg(option[2:])
+ pythonpath = os.environ.get("PYTHONPATH")
+ pythonpath = f"PYTHONPATH={pythonpath}:."
+
# Silence DeprecationWarnings from our dependencies (pyflakes, flake8-bugbear, etc.)
#
# For DeprecationWarnings coming from flake8-pyi itself,
@@ -51,6 +54,8 @@ def test_pyi_file(path: str) -> None:
# but the test failure report that pytest gives is much easier to read
# if we use `-Wdefault:::pyi`
flake8_invocation = [
+ "env",
+ pythonpath,
sys.executable,
"-Wignore",
"-Wdefault:::pyi",