diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2020-01-25 19:03:53 +0100 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2020-01-25 19:03:53 +0100 |
commit | ffa558243ee89b82b7d2d7b83ec55b98222c7c6c (patch) | |
tree | c40fa59353c22b76f4a8545b409732818bfba092 | |
parent | 362e175a7f1edcc19239f0390273cbf6567a0e95 (diff) | |
download | psutil-ffa558243ee89b82b7d2d7b83ec55b98222c7c6c.tar.gz |
fix some tests
-rwxr-xr-x | psutil/tests/test_connections.py | 2 | ||||
-rwxr-xr-x | psutil/tests/test_linux.py | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/psutil/tests/test_connections.py b/psutil/tests/test_connections.py index 93d8473a..c7fe1992 100755 --- a/psutil/tests/test_connections.py +++ b/psutil/tests/test_connections.py @@ -191,10 +191,10 @@ class TestUnconnectedSockets(Base, unittest.TestCase): def get_conn_from_sock(self, sock): cons = thisproc.connections(kind='all') + smap = dict([(c.fd, c) for c in cons]) if NETBSD or FREEBSD: # NetBSD opens a UNIX socket to /var/log/run # so there may be more connections. - smap = dict([(c.fd, c) for c in cons]) return smap[sock.fileno()] else: self.assertEqual(len(cons), 1) diff --git a/psutil/tests/test_linux.py b/psutil/tests/test_linux.py index f503b384..80bbd113 100755 --- a/psutil/tests/test_linux.py +++ b/psutil/tests/test_linux.py @@ -313,6 +313,7 @@ class TestSystemVirtualMemory(unittest.TestCase): self.assertEqual(ret.available, 0) self.assertEqual(ret.slab, 0) + @retry_on_failure() def test_avail_old_percent(self): # Make sure that our calculation of avail mem for old kernels # is off by max 10%. |