diff --git a/Tests/helper.py b/Tests/helper.py index 924b9733403..31bd2abe76a 100644 --- a/Tests/helper.py +++ b/Tests/helper.py @@ -207,7 +207,14 @@ def mark_if_feature_version( return pytest.mark.pil_noop_mark() +def is_pypy() -> bool: + return sys.implementation.name == "pypy" + + @pytest.mark.skipif(sys.platform.startswith("win32"), reason="Requires Unix or macOS") +# Per https://stackoverflow.com/a/29007723/51685, due to JIT compilation, +# RSS utilization is known to grow so measuring it doesn't make that much sense. +@pytest.mark.skipif(is_pypy(), reason="max RSS utilization is not stable on PyPy") class PillowLeakTestCase: # requires unix/macOS iterations = 100 # count @@ -332,7 +339,3 @@ def is_ppc64le() -> bool: def is_win32() -> bool: return sys.platform.startswith("win32") - - -def is_pypy() -> bool: - return sys.implementation.name == "pypy" diff --git a/Tests/test_image.py b/Tests/test_image.py index 24a61ab5b4d..d0516b849f2 100644 --- a/Tests/test_image.py +++ b/Tests/test_image.py @@ -572,7 +572,9 @@ def test_check_size(self) -> None: assert isinstance(i.size, tuple) @timeout_unless_slower_valgrind(0.75) - @pytest.mark.parametrize("size", ((0, 100000000), (100000000, 0))) + @pytest.mark.parametrize( + "size", ((0, 10_000_000), (10_000_000, 0)), ids=("tall", "wide") + ) def test_empty_image(self, size: tuple[int, int]) -> None: Image.new("RGB", size)