From ef849d2dd31167524336575b3e12591149359c70 Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Wed, 17 Feb 2021 17:40:50 +0200 Subject: [PATCH] Handle old psutil in TestProcess --- src/tests/test_process.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tests/test_process.py b/src/tests/test_process.py index 0888c21d..d976aa18 100644 --- a/src/tests/test_process.py +++ b/src/tests/test_process.py @@ -195,6 +195,7 @@ class TestProcess(TestProcessProto): """Check PyBitmessage process name""" self.assertEqual(self.process.name(), 'PyBitmessage') + @unittest.skipIf(psutil.version_info < (4, 0), 'psutil is too old') def test_home(self): """Ensure BITMESSAGE_HOME is used by process""" self.assertEqual( @@ -204,7 +205,7 @@ class TestProcess(TestProcessProto): """Check that pybitmessage listens on port 8444""" for c in self.process.connections(): if c.status == 'LISTEN': - self.assertEqual(c.laddr.port, 8444) + self.assertEqual(c.laddr[1], 8444) break def test_files(self):