@@ -183,6 +183,22 @@ def pytest_collection_modifyitems(items, config):
183
183
# ----------------------------------------------------------------
184
184
# Autouse fixtures
185
185
# ----------------------------------------------------------------
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
+
186
202
@pytest .fixture (autouse = True )
187
203
def configure_tests ():
188
204
"""
@@ -200,20 +216,6 @@ def add_imports(doctest_namespace):
200
216
doctest_namespace ["pd" ] = pd
201
217
202
218
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
-
217
219
# ----------------------------------------------------------------
218
220
# Common arguments
219
221
# ----------------------------------------------------------------
0 commit comments