diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2017-05-16 20:16:57 +0200 |
---|---|---|
committer | Giampaolo Rodola <g.rodola@gmail.com> | 2017-05-16 20:16:57 +0200 |
commit | be82ee662cd5a983c246a97c70a7da664c2bb567 (patch) | |
tree | 44b1a8147ae0bbfd03c6131f8f7594c6ffb5e94f | |
parent | c964dc92424c19a588e348a6cbbb2d53fecec0b5 (diff) | |
download | psutil-be82ee662cd5a983c246a97c70a7da664c2bb567.tar.gz |
prevent AccessDenied on OSX
-rwxr-xr-x | psutil/tests/test_connections.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/psutil/tests/test_connections.py b/psutil/tests/test_connections.py index 4ead7d16..927d5bfb 100755 --- a/psutil/tests/test_connections.py +++ b/psutil/tests/test_connections.py @@ -447,6 +447,7 @@ class TestSystemWideConnections(unittest.TestCase): if x.pid == os.getpid()] self.assertEqual(len(cons), len(socks)) + @skip_on_access_denied() def test_multi_sockets_procs(self): # Creates multiple sub processes, each creating different # sockets. For each process check that proc.connections() @@ -472,10 +473,10 @@ class TestSystemWideConnections(unittest.TestCase): syscons = [x for x in psutil.net_connections(kind='all') if x.pid in pids] for pid in pids: - p = psutil.Process(pid) - self.assertEqual(len(p.connections('all')), expected) self.assertEqual(len([x for x in syscons if x.pid == pid]), expected) + p = psutil.Process(pid) + self.assertEqual(len(p.connections('all')), expected) # ===================================================================== |