Skip to content

Commit 93adea3

Browse files
Remove test
1 parent a07683d commit 93adea3

File tree

3 files changed

+3
-90
lines changed

3 files changed

+3
-90
lines changed

Lib/test/test_bz2.py

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import shutil
1414
import subprocess
1515
import threading
16-
from test.support import import_helper, script_helper
16+
from test.support import import_helper
1717
from test.support import threading_helper
1818
from test.support.os_helper import unlink, FakePath
1919
from compression._common import _streams
@@ -936,35 +936,6 @@ def testPickle(self):
936936
with self.assertRaises(TypeError):
937937
pickle.dumps(BZ2Decompressor(), proto)
938938

939-
def test_decompressor_reuse_after_tail_copy_memory_error(self):
940-
import_helper.import_module("_testcapi")
941-
code = """if 1:
942-
import _testcapi
943-
import bz2
944-
945-
data = bz2.compress(b"S" * (1 << 20))
946-
for skip in range(1, 500):
947-
d = bz2.BZ2Decompressor()
948-
try:
949-
_testcapi.set_nomemory(skip, skip + 1)
950-
try:
951-
d.decompress(data, max_length=0)
952-
except MemoryError:
953-
pass
954-
else:
955-
continue
956-
finally:
957-
_testcapi.remove_mem_hooks()
958-
if d.needs_input:
959-
continue
960-
try:
961-
d.decompress(b"B" * 64, max_length=0)
962-
except Exception:
963-
pass
964-
break
965-
"""
966-
script_helper.assert_python_ok("-c", code)
967-
968939
def testDecompressorChunksMaxsize(self):
969940
bzd = BZ2Decompressor()
970941
max_length = 100

Lib/test/test_lzma.py

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import unittest
99
from compression._common import _streams
1010

11-
from test.support import _4G, bigmemtest, script_helper
11+
from test.support import _4G, bigmemtest
1212
from test.support.import_helper import import_module
1313
from test.support.os_helper import (
1414
TESTFN, unlink, FakePath
@@ -383,35 +383,6 @@ def test_uninitialized_LZMADecompressor_crash(self):
383383
self.assertEqual(LZMADecompressor.__new__(LZMADecompressor).
384384
decompress(bytes()), b'')
385385

386-
def test_decompressor_reuse_after_tail_copy_memory_error(self):
387-
import_module("_testcapi")
388-
code = """if 1:
389-
import _testcapi
390-
import lzma
391-
392-
data = lzma.compress(b"S" * (1 << 20))
393-
for skip in range(1, 500):
394-
d = lzma.LZMADecompressor()
395-
try:
396-
_testcapi.set_nomemory(skip, skip + 1)
397-
try:
398-
d.decompress(data, max_length=0)
399-
except MemoryError:
400-
pass
401-
else:
402-
continue
403-
finally:
404-
_testcapi.remove_mem_hooks()
405-
if d.needs_input:
406-
continue
407-
try:
408-
d.decompress(b"B" * 64, max_length=0)
409-
except Exception:
410-
pass
411-
break
412-
"""
413-
script_helper.assert_python_ok("-c", code)
414-
415386

416387
class CompressDecompressFunctionTestCase(unittest.TestCase):
417388

Lib/test/test_zlib.py

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import unittest
22
from test import support
3-
from test.support import import_helper, script_helper
3+
from test.support import import_helper
44
import binascii
55
import copy
66
import pickle
@@ -1207,35 +1207,6 @@ def test_failure(self):
12071207
# Previously, a second call could crash due to internal inconsistency
12081208
self.assertRaises(Exception, zlibd.decompress, self.BAD_DATA * 30)
12091209

1210-
def test_decompressor_reuse_after_tail_copy_memory_error(self):
1211-
import_helper.import_module("_testcapi")
1212-
code = """if 1:
1213-
import _testcapi
1214-
import zlib
1215-
1216-
data = zlib.compress(b"S" * (1 << 20))
1217-
for skip in range(1, 500):
1218-
d = zlib._ZlibDecompressor()
1219-
try:
1220-
_testcapi.set_nomemory(skip, skip + 1)
1221-
try:
1222-
d.decompress(data, max_length=0)
1223-
except MemoryError:
1224-
pass
1225-
else:
1226-
continue
1227-
finally:
1228-
_testcapi.remove_mem_hooks()
1229-
if d.needs_input:
1230-
continue
1231-
try:
1232-
d.decompress(b"B" * 64, max_length=0)
1233-
except Exception:
1234-
pass
1235-
break
1236-
"""
1237-
script_helper.assert_python_ok("-c", code)
1238-
12391210
@support.refcount_test
12401211
def test_refleaks_in___init__(self):
12411212
gettotalrefcount = support.get_attribute(sys, 'gettotalrefcount')

0 commit comments

Comments
 (0)