From 6935e9dd39327a743ace95273f4f9a62ea0114b4 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Sat, 16 Sep 2017 21:20:04 +0200 Subject: [PATCH] pytester: no ignore files used to obtain current user metadata in the fd leak detector --- _pytest/pytester.py | 7 +++++++ changelog/2784.bugfix | 1 + 2 files changed, 8 insertions(+) create mode 100644 changelog/2784.bugfix diff --git a/_pytest/pytester.py b/_pytest/pytester.py index 263f29e88ef..8ab4bd045b6 100644 --- a/_pytest/pytester.py +++ b/_pytest/pytester.py @@ -22,6 +22,11 @@ from _pytest.assertion.rewrite import AssertionRewritingHook +IGNORE_PAM = [ # filenames added when obtaining details about the current user + u'/var/lib/sss/mc/passwd' +] + + def pytest_addoption(parser): # group = parser.getgroup("pytester", "pytester (self-tests) options") parser.addoption('--lsof', @@ -71,6 +76,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)) diff --git a/changelog/2784.bugfix b/changelog/2784.bugfix new file mode 100644 index 00000000000..88b9ce92c61 --- /dev/null +++ b/changelog/2784.bugfix @@ -0,0 +1 @@ +pytester: no ignore files used to obtain current user metadata in the fd leak detector \ No newline at end of file