Skip to content

Commit 0d9f09c

Browse files
committed
Remove all segfault skips from testing
1 parent f73d256 commit 0d9f09c

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

tests/test_gzip_compliance.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ def test_write(self):
9595
# Test multiple close() calls.
9696
f.close()
9797

98-
@pytest.mark.skip(reason="Causes a segmentation fault.")
9998
def test_write_read_with_pathlike_file(self):
10099
filename = pathlib.Path(self.filename)
101100
with igzip.IGzipFile(filename, 'w') as f:
@@ -111,22 +110,18 @@ def test_write_read_with_pathlike_file(self):
111110
# The following test_write_xy methods test that write accepts
112111
# the corresponding bytes-like object type as input
113112
# and that the data written equals bytes(xy) in all cases.
114-
@pytest.mark.skip(reason="Causes a segmentation fault.")
115113
def test_write_memoryview(self):
116114
self.write_and_read_back(memoryview(data1 * 50))
117115
m = memoryview(bytes(range(256)))
118116
data = m.cast('B', shape=[8,8,4])
119117
self.write_and_read_back(data)
120118

121-
@pytest.mark.skip(reason="Causes a segmentation fault.")
122119
def test_write_bytearray(self):
123120
self.write_and_read_back(bytearray(data1 * 50))
124121

125-
@pytest.mark.skip(reason="Causes a segmentation fault.")
126122
def test_write_array(self):
127123
self.write_and_read_back(array.array('I', data1 * 40))
128124

129-
@pytest.mark.skip(reason="Causes a segmentation fault.")
130125
def test_write_incompatible_type(self):
131126
# Test that non-bytes-like types raise TypeError.
132127
# Issue #21560: attempts to write incompatible types
@@ -140,15 +135,13 @@ def test_write_incompatible_type(self):
140135
with igzip.IGzipFile(self.filename, 'rb') as f:
141136
self.assertEqual(f.read(), data1)
142137

143-
@pytest.mark.skip(reason="Causes a segmentation fault.")
144138
def test_read(self):
145139
self.test_write()
146140
# Try reading.
147141
with igzip.IGzipFile(self.filename, 'r') as f:
148142
d = f.read()
149143
self.assertEqual(d, data1*50)
150144

151-
@pytest.mark.skip(reason="Causes a segmentation fault.")
152145
def test_read1(self):
153146
self.test_write()
154147
blocks = []
@@ -200,7 +193,6 @@ def test_io_on_closed_object(self):
200193
with self.assertRaises(ValueError):
201194
f.flush()
202195

203-
@pytest.mark.skip(reason="Causes a segmentation fault.")
204196
def test_append(self):
205197
self.test_write()
206198
# Append to the previous file
@@ -211,7 +203,6 @@ def test_append(self):
211203
d = f.read()
212204
self.assertEqual(d, (data1*50) + (data2*15))
213205

214-
@pytest.mark.skip(reason="Causes a segmentation fault.")
215206
def test_many_append(self):
216207
# Bug #1074261 was triggered when reading a file that contained
217208
# many, many members. Create such a file and verify that reading it
@@ -231,7 +222,6 @@ def test_many_append(self):
231222
if not ztxt: break
232223
self.assertEqual(contents, b'a'*201)
233224

234-
@pytest.mark.skip(reason="Causes a segmentation fault.")
235225
def test_exclusive_write(self):
236226
with igzip.IGzipFile(self.filename, 'xb') as f:
237227
f.write(data1 * 50)
@@ -240,7 +230,6 @@ def test_exclusive_write(self):
240230
with self.assertRaises(FileExistsError):
241231
igzip.IGzipFile(self.filename, 'xb')
242232

243-
@pytest.mark.skip(reason="Causes a segmentation fault.")
244233
def test_buffered_reader(self):
245234
# Issue #7471: a GzipFile can be wrapped in a BufferedReader for
246235
# performance.
@@ -252,7 +241,6 @@ def test_buffered_reader(self):
252241

253242
self.assertEqual(lines, 50 * data1.splitlines(keepends=True))
254243

255-
@pytest.mark.skip(reason="Causes a segmentation fault.")
256244
def test_readline(self):
257245
self.test_write()
258246
# Try .readline() with varying line lengths
@@ -265,7 +253,6 @@ def test_readline(self):
265253
self.assertTrue(len(L) <= line_length)
266254
line_length = (line_length + 1) % 50
267255

268-
@pytest.mark.skip(reason="Causes a segmentation fault.")
269256
def test_readlines(self):
270257
self.test_write()
271258
# Try .readlines()
@@ -278,7 +265,6 @@ def test_readlines(self):
278265
L = f.readlines(150)
279266
if L == []: break
280267

281-
@pytest.mark.skip(reason="Causes a segmentation fault.")
282268
def test_seek_read(self):
283269
self.test_write()
284270
# Try seek, read test
@@ -298,7 +284,6 @@ def test_seek_read(self):
298284
self.assertEqual(line1[:amount], line2)
299285
f.seek(newpos) # positive seek
300286

301-
@pytest.mark.skip(reason="Causes a segmentation fault.")
302287
def test_seek_whence(self):
303288
self.test_write()
304289
# Try seek(whence=1), read test
@@ -443,7 +428,6 @@ def test_with_open(self):
443428
else:
444429
self.fail("1/0 didn't raise an exception")
445430

446-
@pytest.mark.skip(reason="Causes a segmentation fault.")
447431
def test_zero_padded_file(self):
448432
with igzip.IGzipFile(self.filename, "wb") as f:
449433
f.write(data1 * 50)
@@ -475,7 +459,6 @@ def test_non_seekable_file(self):
475459
with igzip.IGzipFile(fileobj=buf, mode="rb") as f:
476460
self.assertEqual(f.read(), uncompressed)
477461

478-
@pytest.mark.skip(reason="Causes a segmentation fault.")
479462
def test_peek(self):
480463
uncompressed = data1 * 200
481464
with igzip.IGzipFile(self.filename, "wb") as f:
@@ -498,7 +481,6 @@ def sizes():
498481
self.assertEqual(f.read(100), b'')
499482
self.assertEqual(nread, len(uncompressed))
500483

501-
@pytest.mark.skip(reason="Causes a segmentation fault.")
502484
def test_textio_readlines(self):
503485
# Issue #10791: TextIOWrapper.readlines() fails when wrapping GzipFile.
504486
lines = (data1 * 50).decode("ascii").splitlines(keepends=True)
@@ -541,7 +523,6 @@ def test_fileobj_mode(self):
541523
with g:
542524
self.assertEqual(g.mode, igzip.WRITE)
543525

544-
@pytest.mark.skip(reason="Causes a segmentation fault.")
545526
def test_bytes_filename(self):
546527
str_filename = self.filename
547528
try:
@@ -629,7 +610,6 @@ def test_prepend_error(self):
629610
f._buffer.raw._fp.prepend()
630611

631612
class TestOpen(BaseTest):
632-
@pytest.mark.skip(reason="Causes a segmentation fault.")
633613
def test_binary_modes(self):
634614
uncompressed = data1 * 50
635615

@@ -657,7 +637,6 @@ def test_binary_modes(self):
657637
file_data = igzip.decompress(f.read())
658638
self.assertEqual(file_data, uncompressed)
659639

660-
@pytest.mark.skip(reason="Causes a segmentation fault.")
661640
def test_pathlike_file(self):
662641
filename = pathlib.Path(self.filename)
663642
with igzip.open(filename, "wb") as f:
@@ -667,7 +646,6 @@ def test_pathlike_file(self):
667646
with igzip.open(filename) as f:
668647
self.assertEqual(f.read(), data1 * 51)
669648

670-
@pytest.mark.skip(reason="Causes a segmentation fault.")
671649
def test_implicit_binary_modes(self):
672650
# Test implicit binary modes (no "b" or "t" in mode string).
673651
uncompressed = data1 * 50
@@ -696,7 +674,6 @@ def test_implicit_binary_modes(self):
696674
file_data = igzip.decompress(f.read())
697675
self.assertEqual(file_data, uncompressed)
698676

699-
@pytest.mark.skip(reason="Causes a segmentation fault.")
700677
def test_text_modes(self):
701678
uncompressed = data1.decode("ascii") * 50
702679
uncompressed_raw = uncompressed.replace("\n", os.linesep)
@@ -739,7 +716,6 @@ def test_bad_params(self):
739716
with self.assertRaises(ValueError):
740717
igzip.open(self.filename, "rb", newline="\n")
741718

742-
@pytest.mark.skip(reason="Causes a segmentation fault.")
743719
def test_encoding(self):
744720
# Test non-default encoding.
745721
uncompressed = data1.decode("ascii") * 50
@@ -752,7 +728,6 @@ def test_encoding(self):
752728
with igzip.open(self.filename, "rt", encoding="utf-16") as f:
753729
self.assertEqual(f.read(), uncompressed)
754730

755-
@pytest.mark.skip(reason="Causes a segmentation fault.")
756731
def test_encoding_error_handler(self):
757732
# Test with non-default encoding error handler.
758733
with igzip.open(self.filename, "wb") as f:
@@ -761,7 +736,6 @@ def test_encoding_error_handler(self):
761736
as f:
762737
self.assertEqual(f.read(), "foobar")
763738

764-
@pytest.mark.skip(reason="Causes a segmentation fault.")
765739
def test_newline(self):
766740
# Test with explicit newline (universal newline mode disabled).
767741
uncompressed = data1.decode("ascii") * 50
@@ -876,7 +850,6 @@ def test_decompress_cannot_have_flags_compression(self):
876850
self.assertEqual(out, b'')
877851

878852

879-
@pytest.mark.skip(reason="Causes a segmentation fault.")
880853
def test_main(verbose=None):
881854
support.run_unittest(TestGzip, TestOpen, TestCommandLine)
882855

0 commit comments

Comments
 (0)