Author: Matti Picus <matti.pi...@gmail.com> Branch: unicode-utf8-py3 Changeset: r95579:ba673f534eb1 Date: 2019-01-03 18:38 +0200 http://bitbucket.org/pypy/pypy/changeset/ba673f534eb1/
Log: remove python2 files addin in merge from default diff --git a/extra_tests/test_cPickle.py b/extra_tests/test_cPickle.py deleted file mode 100644 --- a/extra_tests/test_cPickle.py +++ /dev/null @@ -1,34 +0,0 @@ -import pytest -import cPickle - -def test_stack_underflow(): - with pytest.raises(cPickle.UnpicklingError): - cPickle.loads("a string") - -def test_bad_key(): - with pytest.raises(cPickle.UnpicklingError) as excinfo: - cPickle.loads("v") - assert str(excinfo.value) == "invalid load key, 'v'." - -def test_find_global(): - import time, cStringIO - entry = time.strptime('Fri Mar 27 22:20:42 2017') - f = cStringIO.StringIO() - cPickle.Pickler(f).dump(entry) - - f = cStringIO.StringIO(f.getvalue()) - e = cPickle.Unpickler(f).load() - assert e == entry - - f = cStringIO.StringIO(f.getvalue()) - up = cPickle.Unpickler(f) - up.find_global = None - with pytest.raises(cPickle.UnpicklingError) as e: - up.load() - assert str(e.value) == "Global and instance pickles are not supported." - - f = cStringIO.StringIO(f.getvalue()) - up = cPickle.Unpickler(f) - up.find_global = lambda module, name: lambda a, b: (name, a, b) - e = up.load() - assert e == ('struct_time', (2017, 3, 27, 22, 20, 42, 4, 86, -1), {}) diff --git a/extra_tests/test_cStringIO.py b/extra_tests/test_cStringIO.py deleted file mode 100644 --- a/extra_tests/test_cStringIO.py +++ /dev/null @@ -1,23 +0,0 @@ -""" -Tests for the PyPy cStringIO implementation. -""" -from cStringIO import StringIO - -data = b"some bytes" - -def test_reset(): - """ - Test that the reset method of cStringIO objects sets the position - marker to the beginning of the stream. - """ - stream = StringIO() - stream.write(data) - assert stream.read() == '' - stream.reset() - assert stream.read() == data - - stream = StringIO(data) - assert stream.read() == data - assert stream.read() == '' - stream.reset() - assert stream.read() == data diff --git a/extra_tests/test_string.py b/extra_tests/test_string.py deleted file mode 100644 --- a/extra_tests/test_string.py +++ /dev/null @@ -1,46 +0,0 @@ - -""" -Test module for functions in string.py -""" -import pytest - -def test_maketrans(): - import string - assert string.maketrans('', '') == ( - '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12' - '\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&\'()*+,-./0' - '123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstu' - 'vwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d' - '\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e' - '\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf' - '\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0' - '\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1' - '\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2' - '\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3' - '\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff') - assert string.maketrans('a', 'b') == ( - '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12' - '\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&\'()*+,-./0' - '123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`bbcdefghijklmnopqrstu' - 'vwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d' - '\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e' - '\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf' - '\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0' - '\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1' - '\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2' - '\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3' - '\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff') - assert string.maketrans('ab', 'cd') == ( - '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12' - '\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&\'()*+,-./0' - '123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`cdcdefghijklmnopqrstu' - 'vwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d' - '\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e' - '\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf' - '\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0' - '\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1' - '\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2' - '\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3' - '\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff') - with pytest.raises(ValueError): - string.maketrans('aa', '') _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit