From 9a53c9c241c8f46ffed3fee280a7dfdd544f7950 Mon Sep 17 00:00:00 2001 From: Martin Wendt Date: Sun, 22 Sep 2024 17:33:27 +0200 Subject: [PATCH] Skip pympler benchmark if not installed --- tests/test_bench.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_bench.py b/tests/test_bench.py index 6796ebf..fd2f1f2 100644 --- a/tests/test_bench.py +++ b/tests/test_bench.py @@ -289,7 +289,11 @@ def test_bench_serialize(self, capsys): class TestMemory: def test_bench_node_size(self, capsys): """ """ - from pympler.asizeof import asized, asizeof + + try: + from pympler.asizeof import asized, asizeof + except ImportError: + raise pytest.skip("pympler not installed") from None results = ["Memory results"] tree = fixture.generate_tree([10, 9])