Unverified Commit 80bdc1e5 authored by isabel's avatar isabel Committed by GitHub
Browse files

python3Packages.srctools: use custom test script for pythoncapi-compat (#496448)

parents ea8bd8be 6bec4ea1
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
  pillow,
  pytest-regressions,
  dirty-equals,
  setuptools,
}:
let
  pname = "srctools";
@@ -25,12 +26,6 @@ buildPythonPackage {
    hash = "sha256-c+NmrTntpNTEI782aoC4bNpoKpWe4cqSAkxpYS5HH30=";
  };

  # TODO remove when https://github.com/python/pythoncapi-compat/pull/169 is merged
  # and new srctools version is released with fix
  patches = [
    ./fix-tests.diff
  ];

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace-fail "meson-python == 0.18.0" "meson-python >= 0.18.0"
@@ -52,8 +47,18 @@ buildPythonPackage {
    pillow
    pytest-regressions
    dirty-equals
    setuptools # required for pythoncapi-compat tests
  ];

  # pythoncpai-comat tests are incompatible with pytest so we run their tests manually
  # see https://github.com/python/pythoncapi-compat/pull/169
  disabledTestPaths = [
    "src/pythoncapi-compat"
  ];
  postCheck = ''
    python3 src/pythoncapi-compat/runtests.py --current
  '';

  pythonImportsCheck = [ "srctools" ];

  meta = {
+0 −13
Original line number Diff line number Diff line
diff --git a/src/pythoncapi-compat/tests/test_pythoncapi_compat.py b/src/pythoncapi-compat/tests/test_pythoncapi_compat.py
index 8480415..4137489 100644
--- a/src/pythoncapi-compat/tests/test_pythoncapi_compat.py
+++ b/src/pythoncapi-compat/tests/test_pythoncapi_compat.py
@@ -21,7 +21,7 @@ except ImportError:
     faulthandler = None
 
 # test.utils
-from utils import run_command, command_stdout
+from .utils import run_command, command_stdout
 
 
 # Windows uses MSVC compiler
 No newline at end of file