Skip to content

Commit

Permalink
Merge pull request #2784 from RonnyPfannschmidt/fix-fdleaks
Browse files Browse the repository at this point in the history
pytester: ignore files used to obtain current user metadata
  • Loading branch information
RonnyPfannschmidt authored Dec 19, 2017
2 parents d370e77 + ed293ec commit 672c901
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions _pytest/pytester.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
PYTEST_FULLPATH = os.path.abspath(pytest.__file__.rstrip("oc")).replace("$py.class", ".py")


IGNORE_PAM = [ # filenames added when obtaining details about the current user
u'/var/lib/sss/mc/passwd'
]


def pytest_addoption(parser):
parser.addoption('--lsof',
action="store_true", dest="lsof", default=False,
Expand Down Expand Up @@ -66,6 +71,8 @@ def isopen(line):
fields = line.split('\0')
fd = fields[0][1:]
filename = fields[1][1:]
if filename in IGNORE_PAM:
continue
if filename.startswith('/'):
open_files.append((fd, filename))

Expand Down
1 change: 1 addition & 0 deletions changelog/2784.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytester: ignore files used to obtain current user metadata in the fd leak detector.

0 comments on commit 672c901

Please sign in to comment.