Skip to content

Commit 9d23ff4

Browse files
committed
Restrict to file numbers, fix match to search
1 parent 4f164f5 commit 9d23ff4

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

pandas/conftest.py

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,22 @@ def pytest_collection_modifyitems(items, config):
183183
# ----------------------------------------------------------------
184184
# Autouse fixtures
185185
# ----------------------------------------------------------------
186+
pat = re.compile(r"python3")
187+
188+
189+
@pytest.fixture(autouse=True)
190+
def check_bufferedrandom_resourcewarning():
191+
yield
192+
lsof = subprocess.run(["lsof", "-d", "0-25"], capture_output=True).stdout.decode(
193+
"utf-8"
194+
)
195+
for line in lsof.split("\n"):
196+
if re.search(pat, line):
197+
# sys.stderr for xdist
198+
# https://github.com/pytest-dev/pytest/issues/1693#issuecomment-233282644
199+
print(line, flush=True, file=sys.stderr)
200+
201+
186202
@pytest.fixture(autouse=True)
187203
def configure_tests():
188204
"""
@@ -200,20 +216,6 @@ def add_imports(doctest_namespace):
200216
doctest_namespace["pd"] = pd
201217

202218

203-
pat = re.compile(r"(0?[1-9]|1[0-9]|2[0-5])u")
204-
205-
206-
@pytest.fixture(autouse=True)
207-
def check_bufferedrandom_resourcewarning():
208-
yield
209-
lsof = subprocess.run(["lsof"], capture_output=True).stdout.decode("utf-8")
210-
for line in lsof.split("\n"):
211-
if re.match(pat, line):
212-
# sys.stderr for xdist
213-
# https://github.com/pytest-dev/pytest/issues/1693#issuecomment-233282644
214-
print(line, flush=True, file=sys.stderr)
215-
216-
217219
# ----------------------------------------------------------------
218220
# Common arguments
219221
# ----------------------------------------------------------------

0 commit comments

Comments
 (0)