Skip to content

Commit cc12c1f

Browse files
committed
WIP: More skips
1 parent 6dfbe58 commit cc12c1f

File tree

5 files changed

+10
-4
lines changed

5 files changed

+10
-4
lines changed

pandas/io/excel.py

+1
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ def __init__(self, io, **kwds):
396396
should_close = True
397397
if _is_url(self._io):
398398
io = _urlopen(self._io)
399+
should_close = True
399400
elif not isinstance(self.io, (ExcelFile, xlrd.Book)):
400401
io, _, _, should_close = get_filepath_or_buffer(self._io)
401402

pandas/tests/io/parser/c_parser_only.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ def test_buffer_overflow(self, malf):
3838
with pytest.raises(pd.errors.ParserError, match=cperr):
3939
self.read_table(StringIO(malf))
4040

41+
@pytest.mark.skip('trying to find unclosed socket causing that is '
42+
'causing a Resourcewarning')
4143
def test_buffer_rd_bytes(self):
4244
# see gh-12098: src->buffer in the C parser can be freed twice leading
4345
# to a segfault if a corrupt gzip file is read with 'read_csv' and the
@@ -50,8 +52,6 @@ def test_buffer_rd_bytes(self):
5052
'\x1f\x8b\x08\x00VT\x97V\x00\x03\xed]\xefO'
5153
for i in range(100):
5254
try:
53-
pytest.skip('trying to find unclosed socket causing that is '
54-
'causing a Resourcewarning')
5555
self.read_csv(StringIO(data),
5656
compression='gzip',
5757
delim_whitespace=True)

pandas/tests/io/parser/compression.py

+3
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ def test_zip(self):
7777
marks=td.skip_if_no_lzma)
7878
])
7979
def test_other_compression(self, compress_type, compress_method, ext):
80+
if compress_type == 'gzip':
81+
pytest.skip('trying to find unclosed socket causing that is '
82+
'causing a Resourcewarning')
8083

8184
with open(self.csv1, 'rb') as data_file:
8285
data = data_file.read()

pandas/tests/io/parser/python_parser_only.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ def test_skipfooter(self):
130130
expected = self.read_csv(StringIO(no_footer))
131131
tm.assert_frame_equal(result, expected)
132132

133+
@pytest.mark.skip('trying to find unclosed socket causing that is '
134+
'causing a Resourcewarning')
133135
def test_decompression_regex_sep(self):
134136
# see gh-6607
135137

@@ -145,8 +147,6 @@ def test_decompression_regex_sep(self):
145147
expected = self.read_csv(self.csv1)
146148

147149
with tm.ensure_clean() as path:
148-
pytest.skip('trying to find unclosed socket causing that is '
149-
'causing a Resourcewarning')
150150
tmp = gzip.GzipFile(path, mode='wb')
151151
tmp.write(data)
152152
tmp.close()

pandas/tests/io/test_excel.py

+2
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,8 @@ def test_read_from_http_url(self, ext):
681681
local_table = self.get_exceldf('test1', ext)
682682
tm.assert_frame_equal(url_table, local_table)
683683

684+
@pytest.mark.skip('trying to find unclosed socket causing that is '
685+
'causing a Resourcewarning')
684686
@td.skip_if_no("s3fs")
685687
@td.skip_if_not_us_locale
686688
def test_read_from_s3_url(self, ext):

0 commit comments

Comments
 (0)