From 1879e28e94bb2c4b8a6331fa5a4bc2f9e6440a89 Mon Sep 17 00:00:00 2001 From: Lee Miller Date: Sun, 20 Oct 2024 01:59:16 +0300 Subject: [PATCH] Remove the dependency on objgraph --- minode/tests/test_memory.py | 10 ++++++---- requirements.txt | 1 - 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/minode/tests/test_memory.py b/minode/tests/test_memory.py index 12f1197..dae2377 100644 --- a/minode/tests/test_memory.py +++ b/minode/tests/test_memory.py @@ -2,7 +2,6 @@ import gc import time -import objgraph from minode import shared @@ -50,6 +49,9 @@ class TestListener(TestProcessProto): self.fail('The connection is alive') gc.collect() - for c in objgraph.by_type('Connection'): - if c not in shared.connections: - self.fail('Connection %s remained in memory' % c) + for obj in gc.get_objects(): + if ( + isinstance(obj, shared.connection) + and obj not in shared.connections + ): + self.fail('Connection %s remains in memory' % obj) diff --git a/requirements.txt b/requirements.txt index 1aec856..e560573 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,2 @@ coverage -objgraph psutil