tests: hide memory-mapped files from lsof output

Seems to be no saner way to do this.
This commit is contained in:
David Wilson 2019-08-17 14:34:25 +01:00
parent f4cf67f0bd
commit 8f99ebdf6f
1 changed files with 1 additions and 1 deletions

View File

@ -338,7 +338,7 @@ class TestCase(unittest2.TestCase):
def _teardown_check_fds(self):
mitogen.core.Latch._on_fork()
if get_fd_count() != self._fd_count_before:
import os; os.system('lsof +E -w -p %s' % (os.getpid(),))
import os; os.system('lsof +E -w -p %s | grep -vw mem' % (os.getpid(),))
assert 0, "%s leaked FDs. Count before: %s, after: %s" % (
self, self._fd_count_before, get_fd_count(),
)