Skip to content

Commit 161fc79

Browse files
jbrockmendelproost
authored andcommitted
CI: test for file leakage (pandas-dev#30162)
1 parent a6e83a1 commit 161fc79

File tree

6 files changed

+30
-5
lines changed

6 files changed

+30
-5
lines changed

ci/deps/azure-36-locale_slow.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies:
1818
- lxml
1919
- matplotlib=2.2.2
2020
- numpy=1.14.*
21-
- openpyxl=2.4.8
21+
- openpyxl=2.5.7
2222
- python-dateutil
2323
- python-blosc
2424
- pytz=2017.2

ci/deps/azure-36-minimum_versions.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ dependencies:
1111
- pytest-xdist>=1.21
1212
- hypothesis>=3.58.0
1313
- pytest-azurepipelines
14+
- psutil
1415

1516
# pandas dependencies
1617
- beautifulsoup4=4.6.0
1718
- bottleneck=1.2.1
1819
- jinja2=2.8
1920
- numexpr=2.6.2
2021
- numpy=1.13.3
21-
- openpyxl=2.4.8
22+
- openpyxl=2.5.7
2223
- pytables=3.4.2
2324
- python-dateutil=2.6.1
2425
- pytz=2017.2

doc/source/getting_started/install.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ gcsfs 0.2.2 Google Cloud Storage access
255255
html5lib HTML parser for read_html (see :ref:`note <optional_html>`)
256256
lxml 3.8.0 HTML parser for read_html (see :ref:`note <optional_html>`)
257257
matplotlib 2.2.2 Visualization
258-
openpyxl 2.4.8 Reading / writing for xlsx files
258+
openpyxl 2.5.7 Reading / writing for xlsx files
259259
pandas-gbq 0.8.0 Google Big Query access
260260
psycopg2 PostgreSQL engine for sqlalchemy
261261
pyarrow 0.12.0 Parquet, ORC (requires 0.13.0), and feather reading / writing

doc/source/whatsnew/v1.0.0.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ Optional libraries below the lowest tested version may still work, but are not c
424424
+-----------------+-----------------+---------+
425425
| matplotlib | 2.2.2 | |
426426
+-----------------+-----------------+---------+
427-
| openpyxl | 2.4.8 | |
427+
| openpyxl | 2.5.7 | X |
428428
+-----------------+-----------------+---------+
429429
| pyarrow | 0.12.0 | X |
430430
+-----------------+-----------------+---------+

pandas/compat/_optional.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"matplotlib": "2.2.2",
1515
"numexpr": "2.6.2",
1616
"odfpy": "1.3.0",
17-
"openpyxl": "2.4.8",
17+
"openpyxl": "2.5.7",
1818
"pandas_gbq": "0.8.0",
1919
"pyarrow": "0.12.0",
2020
"pytables": "3.4.2",

pandas/tests/io/excel/conftest.py

+24
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import pytest
22

3+
import pandas.util._test_decorators as td
4+
35
import pandas.util.testing as tm
46

57
from pandas.io.parsers import read_csv
@@ -39,3 +41,25 @@ def read_ext(request):
3941
Valid extensions for reading Excel files.
4042
"""
4143
return request.param
44+
45+
46+
@pytest.fixture(autouse=True)
47+
def check_for_file_leaks():
48+
"""
49+
Fixture to run around every test to ensure that we are not leaking files.
50+
51+
See also
52+
--------
53+
_test_decorators.check_file_leaks
54+
"""
55+
# GH#30162
56+
psutil = td.safe_import("psutil")
57+
if not psutil:
58+
yield
59+
60+
else:
61+
proc = psutil.Process()
62+
flist = proc.open_files()
63+
yield
64+
flist2 = proc.open_files()
65+
assert flist == flist2

0 commit comments

Comments
 (0)