python311Packages.pympler: fix tests

This commit is contained in:
Ryan Hendrickson 2023-05-20 14:40:24 -04:00
parent 95483d41fa
commit f07f108c7c

View file

@ -1,7 +1,10 @@
{ lib, stdenv
, bottle
, buildPythonPackage
, fetchpatch
, fetchPypi
, pytestCheckHook
, pythonAtLeast
}:
buildPythonPackage rec {
@ -13,14 +16,36 @@ buildPythonPackage rec {
sha256 = "993f1a3599ca3f4fcd7160c7545ad06310c9e12f70174ae7ae8d4e25f6c5d3fa";
};
patches = [
# Fixes a TypeError on Python 3.11
# (see https://github.com/pympler/pympler/issues/148)
(fetchpatch {
name = "${pname}-python-3.11-compat.patch";
url = "https://github.com/pympler/pympler/pull/149.patch";
hash = "sha256-6MK0AuhVhQkUzlk29HUh1+mSbfsVTBJ1YBtYNIFhh7U=";
})
];
nativeCheckInputs = [
pytestCheckHook
];
# There is a version of bottle bundled with Pympler, but it is broken on
# Python 3.11. Fortunately, Pympler will preferentially import an external
# bottle if it is available, so we make it an explicit dependency.
propagatedBuildInputs = [
bottle
];
disabledTests = [
# 'AssertionError: 'function (test.muppy.test_summary.func)' != 'function (muppy.test_summary.func)'
# https://github.com/pympler/pympler/issues/134
"test_repr_function"
] ++ lib.optionals (pythonAtLeast "3.11") [
# https://github.com/pympler/pympler/issues/148
"test_findgarbage"
"test_get_tree"
"test_prune"
];
doCheck = stdenv.hostPlatform.isLinux;