summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_bytes.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix DeprecationWarning in test_bytes (GH-10805)Victor Stinner2018-11-301-2/+2
| | | | Running test_bytes with python -3 -Wd emits two DeprecationWarning on "1/0". Use "1//0" to prevent the warning.
* [2.7] bpo-34974: Do not replace unexpected errors in bytearray(). (GH-9852) ↵Serhiy Storchaka2018-10-151-2/+16
| | | | | | | (GH-9885) The bytearray constructor converted unexpected exceptions (e.g. MemoryError and KeyboardInterrupt) to TypeError. (cherry picked from commit e890421e334ccf0c000c6b29c4a521d86cd12f47)
* [2.7] Add new tests for bytes and bytearray constructors. (GH-9843) (#9866)Serhiy Storchaka2018-10-141-3/+56
| | | | | | Covered all special cases: bytes, tuple, list, differend kinds of iterables and iterators. (cherry picked from commit 1a997eb291fdc5f5606c898fffbde61d899ed762)
* [2.7] bpo-20047: Make bytearray methods partition() and rpartition() ↵Serhiy Storchaka2017-10-291-6/+29
| | | | | | rejecting (GH-4158) (#4163) separators that are not bytes-like objects.. (cherry picked from commit a2314283ff87c65e1745a42c2f2b716b1a209128)
* Issue #27039: Fixed bytearray.remove() for values greater than 127.Serhiy Storchaka2016-05-161-0/+7
| | | | Patch by Joe Jevnik.
* Issue #26712: Unify (r)split(), (l/r)strip() tests into string_testsMartin Panter2016-04-101-71/+4
| | | | This eliminates a few redundant test cases.
* Issue #26257: Eliminate buffer_tests.py and fix ByteArrayAsStringTestMartin Panter2016-04-061-16/+6
| | | | | | | | | | | ByteArrayAsStringTest.fixtype() was converting test data to bytes, not byte- array, therefore many of the test cases inherited in this class were not actually being run on the bytearray type. The tests in buffer_tests.py were redundant with methods in string_tests .MixinStrUnicodeUserStringTest and string_tests.CommonTest. Moved some tests into a new base class string_tests.NonStringModuleTest, and run them for bytearray.
* Issue #26492: Added additional tests for exhausted iterators of mutable ↵Serhiy Storchaka2016-03-301-0/+10
| | | | sequences.
* Issue #26494: Fixed crash on iterating exhausting iterators.Serhiy Storchaka2016-03-301-0/+4
| | | | | Affected classes are generic sequence iterators, iterators of bytearray, list, tuple, set, frozenset, dict, OrderedDict and corresponding views.
* Issue #24467: Fixed possible buffer over-read in bytearray. The bytearraySerhiy Storchaka2015-06-291-1/+18
| | | | | object now always allocates place for trailing null byte and it's buffer now is always null-terminated.
* Adapt test for build --without-doc-strings.Stefan Krah2013-01-261-0/+1
|
* #8401: assigning an int to a bytearray slice (e.g. b[3:4] = 5) now raises an ↵Ezio Melotti2012-11-031-0/+20
| | | | error.
* startswith and endswith don't accept None as slice index. Patch by Torsten ↵Jesus Cea2011-04-201-0/+62
| | | | Becker. (closes #11828)
* Merged revisions 88735 via svnmerge fromEli Bendersky2011-03-041-1/+1
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r88735 | eli.bendersky | 2011-03-04 06:55:25 +0200 (Fri, 04 Mar 2011) | 2 lines Issue #11386: Fixed the exception thrown by bytearray.pop() for empty bytearrays ........
* Merged revisions 86596 via svnmerge fromEzio Melotti2010-11-211-13/+13
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line #9424: Replace deprecated assert* methods in the Python test suite. ........
* Merged revisions 84470-84471,84566-84567,84759 via svnmerge fromFlorent Xicluna2010-09-131-16/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84470 | florent.xicluna | 2010-09-03 22:00:37 +0200 (ven., 03 sept. 2010) | 1 line Strengthen BytesWarning tests. ........ r84471 | florent.xicluna | 2010-09-03 22:23:40 +0200 (ven., 03 sept. 2010) | 1 line Typo ........ r84566 | florent.xicluna | 2010-09-06 22:27:15 +0200 (lun., 06 sept. 2010) | 1 line typo ........ r84567 | florent.xicluna | 2010-09-06 22:27:55 +0200 (lun., 06 sept. 2010) | 1 line typo ........ r84759 | florent.xicluna | 2010-09-13 04:28:18 +0200 (lun., 13 sept. 2010) | 1 line Reenable test_ucs4 and remove some duplicated lines. ........
* have a clear error when passing something > sys.maxsize to bytearrayBenjamin Peterson2010-04-161-0/+1
|
* fix typoBenjamin Peterson2010-04-161-1/+1
|
* bytearray -> type2testBenjamin Peterson2010-04-161-8/+8
|
* Various tests cleanup: check_warnings/check_py3k_warnings, unittest.assert* ↵Florent Xicluna2010-03-191-2/+2
| | | | and setUp/tearDown.
* Issue #7788: Fix a crash produced by deleting a list slice with hugeMark Dickinson2010-01-291-1/+1
| | | | step value. Patch by Marcin Bachry.
* use assert[Not]IsInstance where appropriateEzio Melotti2010-01-241-1/+1
|
* use assert[Not]In where appropriateEzio Melotti2010-01-231-15/+14
|
* Issue #7561: Operations on empty bytearrays (such as `int(bytearray())`)Antoine Pitrou2010-01-171-0/+7
| | | | | | could crash in many places because of the PyByteArray_AS_STRING() macro returning NULL. The macro now returns a statically allocated empty string instead.
* Issue #7625: Add more tests that bytearray methods return new objects,Antoine Pitrou2010-01-131-1/+7
| | | | even if identical. Patch by Florent Xicluna (again).
* Issue #7654: enable additional bytes/bytearray tests. Patch by Florent Xicluna.Antoine Pitrou2010-01-121-15/+10
|
* backport keyword argument support for bytearray.decodeBenjamin Peterson2009-09-181-0/+2
|
* Issue #6846: bytearray.pop was returning ints in the range [-128, 128)Mark Dickinson2009-09-061-0/+2
| | | | instead of [0, 256). Thanks Hagen Fürstenau for the report and fix.
* convert usage of fail* to assert*Benjamin Peterson2009-06-301-55/+55
|
* fix building the core with --disable-unicodeBenjamin Peterson2009-01-251-1/+0
| | | | | I changed some bytearray methods to use strings instead of unicode like bytes_repr Also, bytearray.fromhex() can take strings as well as unicode
* Backport r67974:Georg Brandl2008-12-281-0/+10
| | | | | | #4759: allow None as first argument of bytearray.translate(), for consistency with bytes.translate(). Also fix segfault for bytearray.translate(x, None) -- will backport this part to 3.0 and 2.6.
* Issue #4509: bugs in bytearray with exports (buffer protocol)Antoine Pitrou2008-12-061-0/+32
|
* oops! didn't mean to disable that testBenjamin Peterson2008-11-201-1/+1
|
* make sure that bytearray methods return a new bytearray even if there is no ↵Benjamin Peterson2008-11-191-0/+10
| | | | | | | change Fixes #4348 Reviewed by Brett
* Issue #4183: Some tests didn't run with pickle.HIGHEST_PROTOCOL.Hirokazu Yamamoto2008-10-231-2/+2
|
* Fix bug 3625: test issues on 64bit windows. r=pitrouMark Hammond2008-08-231-1/+1
|
* Byte items *can* be chars in 2.6.Georg Brandl2008-07-161-1/+2
|
* #3156: fix consistency in what type bytearray methods accept as items.Georg Brandl2008-07-161-16/+25
| | | | Also rename confusing "item" parameters to "index".
* Merged revisions ↵Christian Heimes2008-03-261-0/+982
61750,61752,61754,61756,61760,61763,61768,61772,61775,61805,61809,61812,61819,61917,61920,61930,61933-61934 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/trunk-bytearray ........ r61750 | christian.heimes | 2008-03-22 20:47:44 +0100 (Sat, 22 Mar 2008) | 1 line Copied files from py3k w/o modifications ........ r61752 | christian.heimes | 2008-03-22 20:53:20 +0100 (Sat, 22 Mar 2008) | 7 lines Take One * Added initialization code, warnings, flags etc. to the appropriate places * Added new buffer interface to string type * Modified tests * Modified Makefile.pre.in to compile the new files * Added bytesobject.c to Python.h ........ r61754 | christian.heimes | 2008-03-22 21:22:19 +0100 (Sat, 22 Mar 2008) | 2 lines Disabled bytearray.extend for now since it causes an infinite recursion Fixed serveral unit tests ........ r61756 | christian.heimes | 2008-03-22 21:43:38 +0100 (Sat, 22 Mar 2008) | 5 lines Added PyBytes support to several places: str + bytearray ord(bytearray) bytearray(str, encoding) ........ r61760 | christian.heimes | 2008-03-22 21:56:32 +0100 (Sat, 22 Mar 2008) | 1 line Fixed more unit tests related to type('') is not unicode ........ r61763 | christian.heimes | 2008-03-22 22:20:28 +0100 (Sat, 22 Mar 2008) | 2 lines Fixed more unit tests Fixed bytearray.extend ........ r61768 | christian.heimes | 2008-03-22 22:40:50 +0100 (Sat, 22 Mar 2008) | 1 line Implemented old buffer interface for bytearray ........ r61772 | christian.heimes | 2008-03-22 23:24:52 +0100 (Sat, 22 Mar 2008) | 1 line Added backport of the io module ........ r61775 | christian.heimes | 2008-03-23 03:50:49 +0100 (Sun, 23 Mar 2008) | 1 line Fix str assignement to bytearray. Assignment of a str of size 1 is interpreted as a single byte ........ r61805 | christian.heimes | 2008-03-23 19:33:48 +0100 (Sun, 23 Mar 2008) | 3 lines Fixed more tests Fixed bytearray() comparsion with unicode() Fixed iterator assignment of bytearray ........ r61809 | christian.heimes | 2008-03-23 21:02:21 +0100 (Sun, 23 Mar 2008) | 2 lines str(bytesarray()) now returns the bytes and not the representation of the bytearray object Enabled and fixed more unit tests ........ r61812 | christian.heimes | 2008-03-23 21:53:08 +0100 (Sun, 23 Mar 2008) | 3 lines Clear error PyNumber_AsSsize_t() fails Use CHARMASK for ob_svall access disabled a test with memoryview again ........ r61819 | christian.heimes | 2008-03-23 23:05:57 +0100 (Sun, 23 Mar 2008) | 1 line Untested updates to the PCBuild directory ........ r61917 | christian.heimes | 2008-03-26 00:57:06 +0100 (Wed, 26 Mar 2008) | 1 line The type system of Python 2.6 has subtle differences to 3.0's. I've removed the Py_TPFLAGS_BASETYPE flags from bytearray for now. bytearray can't be subclasses until the issues with bytearray subclasses are fixed. ........ r61920 | christian.heimes | 2008-03-26 01:44:08 +0100 (Wed, 26 Mar 2008) | 2 lines Disabled last failing test I don't understand what the test is testing and how it suppose to work. Ka-Ping, please check it out. ........ r61930 | christian.heimes | 2008-03-26 12:46:18 +0100 (Wed, 26 Mar 2008) | 1 line Re-enabled bytes warning code ........ r61933 | christian.heimes | 2008-03-26 13:20:46 +0100 (Wed, 26 Mar 2008) | 1 line Fixed a bug in the new buffer protocol. The buffer slots weren't copied into a subclass. ........ r61934 | christian.heimes | 2008-03-26 13:25:09 +0100 (Wed, 26 Mar 2008) | 1 line Re-enabled bytearray subclassing - all tests are passing. ........