summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_struct.py
Commit message (Collapse)AuthorAgeFilesLines
* Issue #15467: Merge 3.2Martin v. Löwis2012-07-291-30/+10
|\
| * Issue #15467: Move helpers for __sizeof__ tests into test_support.Martin v. Löwis2012-07-291-29/+10
| | | | | | | | Patch by Serhiy Storchaka.
* | Issue #15402: Simplify Struct.__sizeof__ and make tests more precise.Meador Inge2012-07-291-10/+41
|\ \ | |/
| * Issue #15402: Simplify Struct.__sizeof__ and make tests more precise.Meador Inge2012-07-291-10/+41
| |
* | MERGE: Better test for Issue #15402: Add a __sizeof__ method to struct.StructJesus Cea2012-07-231-4/+4
|\ \ | |/
| * Better test for Issue #15402: Add a __sizeof__ method to struct.StructJesus Cea2012-07-231-4/+4
| |
* | Issue #15402: Add a __sizeof__ method to struct.Struct.Meador Inge2012-07-231-0/+10
|\ \ | |/ | | | | Initial patch by Serhiy Storchaka.
| * Issue #15402: Add a __sizeof__ method to struct.Struct.Meador Inge2012-07-231-0/+10
| | | | | | | | Initial patch by Serhiy Storchaka.
* | Issue #3163: The struct module gets new format characters 'n' and 'N'Antoine Pitrou2011-10-061-25/+41
|/ | | | supporting C integer types `ssize_t` and `size_t`, respectively.
* #11565: Merge with 3.1.Ezio Melotti2011-03-161-1/+1
|\
| * #11565: Fix several typos. Patch by Piotr Kasprzyk.Ezio Melotti2011-03-161-1/+1
| |
| * Merged revisions 82637 via svnmerge fromBenjamin Peterson2010-07-071-4/+8
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r82637 | benjamin.peterson | 2010-07-07 17:45:06 -0500 (Wed, 07 Jul 2010) | 1 line ValueError in this case is also acceptable ........
| * Merged revisions 82628,82630 via svnmerge fromBenjamin Peterson2010-07-071-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r82628 | benjamin.peterson | 2010-07-07 13:44:05 -0500 (Wed, 07 Jul 2010) | 1 line this needn't be in the loop ........ r82630 | benjamin.peterson | 2010-07-07 13:54:59 -0500 (Wed, 07 Jul 2010) | 1 line don't ignore exceptions from PyObject_IsTrue ........
| * Merged revisions 81897-81898,81902 via svnmerge fromMark Dickinson2010-06-111-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r81897 | mark.dickinson | 2010-06-11 17:56:34 +0100 (Fri, 11 Jun 2010) | 1 line Avoid possible undefined behaviour from signed overflow. ........ r81898 | mark.dickinson | 2010-06-11 20:05:08 +0100 (Fri, 11 Jun 2010) | 1 line Fix an incorrect return type. ........ r81902 | mark.dickinson | 2010-06-11 20:50:30 +0100 (Fri, 11 Jun 2010) | 1 line Fix more undefined-behaviour inducing overflow checks in struct module. ........
| * Merged revisions 78692 via svnmerge fromMark Dickinson2010-03-051-6/+2
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r78692 | mark.dickinson | 2010-03-05 14:44:08 +0000 (Fri, 05 Mar 2010) | 1 line Remove unused imports & clean up sys imports in test_struct. ........
| * Merged revisions 73715 via svnmerge fromGeorg Brandl2009-08-131-2/+2
| | | | | | | | | | | | | | | | | | | | svn+ssh://svn.python.org/python/branches/py3k ........ r73715 | benjamin.peterson | 2009-07-01 01:06:06 +0200 (Mi, 01 Jul 2009) | 1 line convert old fail* assertions to assert* ........
* | Issue #10783: struct.pack() doesn't encode implicitly unicode to UTF-8Victor Stinner2010-12-281-57/+46
| | | | | | | | | | | | | | * Replace "bytes" by "bytes object" in struct error messages * Document the API change in What's new in Python 3.2 * Fix test_wave * Remove also ugly implicit conversions in test_struct
* | Issue #8990: array.fromstring() and array.tostring() get renamed toAntoine Pitrou2010-09-011-4/+4
| | | | | | | | | | | | frombytes() and tobytes(), respectively, to avoid confusion. Furthermore, array.frombytes(), array.extend() as well as the array.array() constructor now accept bytearray objects. Patch by Thomas Jollans.
* | Add test for memory leak reported in issue 9422.Mark Dickinson2010-08-011-1/+6
| |
* | Issue #4770: Restrict binascii module to accept only bytes (as specified).Florent Xicluna2010-07-271-0/+1
| | | | | | | | And fix the email package to encode to ASCII instead of ``raw-unicode-escape`` before ASCII-to-binary decoding.
* | Yield more information on failure in test_struct boolean test.Mark Dickinson2010-07-121-2/+7
| |
* | ValueError is eventually what we want to move to, I supposeBenjamin Peterson2010-07-101-2/+2
| |
* | wrapBenjamin Peterson2010-07-091-1/+2
| |
* | allow more exceptionsBenjamin Peterson2010-07-091-3/+3
| |
* | OverflowError is fineBenjamin Peterson2010-07-091-1/+2
| |
* | ValueError in this case is also acceptableBenjamin Peterson2010-07-071-4/+8
| |
* | don't ignore exceptions from PyObject_IsTrueBenjamin Peterson2010-07-071-0/+6
| |
* | this needn't be in the loopBenjamin Peterson2010-07-071-2/+2
| |
* | Fix more undefined-behaviour inducing overflow checks in struct module.Mark Dickinson2010-06-111-0/+2
| |
* | Avoid possible undefined behaviour from signed overflow.Mark Dickinson2010-06-111-0/+5
| |
* | Issue #3129: Trailing digits in format string are no longer ignored.Alexander Belopolsky2010-06-111-1/+27
| |
* | Merged revisions 79745 via svnmerge fromMark Dickinson2010-04-041-10/+31
| | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79745 | mark.dickinson | 2010-04-04 09:43:04 +0100 (Sun, 04 Apr 2010) | 3 lines Issue #8300 (__index__ handling in struct.pack): Remove redundant check and improve test coverage. Thanks Meador Inge for the patch. ........
* | Merged revisions 79740 via svnmerge fromEzio Melotti2010-04-041-8/+8
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79740 | ezio.melotti | 2010-04-04 10:00:02 +0300 (Sun, 04 Apr 2010) | 1 line Use more specific assert* methods in test_struct. ........
* | Merged revisions 79674 via svnmerge fromMark Dickinson2010-04-031-0/+17
| | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r79674 | mark.dickinson | 2010-04-03 15:05:10 +0100 (Sat, 03 Apr 2010) | 3 lines Issue #8300: Let struct.pack use __index__ to convert and pack non-integers. Based on a patch by Meador Inge. ........
* | Clean up integer tests in test_struct, and bring them more in line with the ↵Mark Dickinson2010-04-031-168/+125
| | | | | | | | trunk tests.
* | Remove unused imports & clean up sys imports in test_struct.Mark Dickinson2010-03-051-6/+2
| |
* | convert old fail* assertions to assert*Benjamin Peterson2009-06-301-2/+2
|/
* Issue #5463: Remove deprecated float coercion from struct module, alongMark Dickinson2009-04-191-58/+15
| | | | | with the _PY_STRUCT_FLOAT_COERCE constant. Simplify tests accordingly, and reenable (now-fixed) broken tests.
* Merged revisions 70837,70864,70878,71004,71032,71043 via svnmerge fromBenjamin Peterson2009-04-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r70837 | gregory.p.smith | 2009-03-31 11:54:10 -0500 (Tue, 31 Mar 2009) | 9 lines The unittest.TestCase.assertEqual() now displays the differences in lists, tuples, dicts and sets on failure. Many new handy type and comparison specific assert* methods have been added that fail with error messages actually useful for debugging. Contributed in by Google and completed with help from mfoord and GvR at PyCon 2009 sprints. Discussion lives in http://bugs.python.org/issue2578. ........ r70864 | gregory.p.smith | 2009-03-31 14:03:28 -0500 (Tue, 31 Mar 2009) | 10 lines Rename the actual method definitions to the official assertFoo names. Adds unittests to make sure the old fail* names continue to work now and adds a comment that they are pending deprecation. Also adds a test to confirm that the plural Equals method variants continue to exist even though we're unlikely to deprecate those. http://bugs.python.org/issue2578 ........ r70878 | gregory.p.smith | 2009-03-31 14:59:14 -0500 (Tue, 31 Mar 2009) | 3 lines Issue an actual PendingDeprecationWarning for the TestCase.fail* methods. Document the deprecation. ........ r71004 | benjamin.peterson | 2009-04-01 18:15:49 -0500 (Wed, 01 Apr 2009) | 1 line remove double underscores ........ r71032 | michael.foord | 2009-04-01 22:20:38 -0500 (Wed, 01 Apr 2009) | 13 lines Better exception messages for unittest assert methods. - unittest.assertNotEqual() now uses the inequality operator (!=) instead of the equality operator. - Default assertTrue and assertFalse messages are now useful. - TestCase has a longMessage attribute. This defaults to False, but if set to True useful error messages are shown in addition to explicit messages passed to assert methods. Issue #5663 ........ r71043 | michael.foord | 2009-04-02 00:51:54 -0500 (Thu, 02 Apr 2009) | 7 lines Store the functions in the _type_equality_funcs as wrapped objects that are deep copyable. This allows for the deep copying of TestCase instances. Issue 5660 ........
* Issue #5463: Remove _PY_STRUCT_RANGE_CHECKING constant from structMark Dickinson2009-03-291-48/+26
| | | | | | module, and remove associated code from test_struct. This was a mechanism for skipping some of the tests for overflow behaviour when packing integers; it's no longer necessary.
* - Issue #5463: In struct module, remove deprecated overflow wrappingMark Dickinson2009-03-211-11/+1
| | | | | | | when packing an integer: for example, struct.pack('=L', -1) now raises struct.error instead of returning b'\xff\xff\xff\xff'. Thanks Andreas Schawo for the patch.
* #3694: fix an "XXX undetected error" leak in struct.Georg Brandl2009-02-131-0/+4
|
* Merged revisions 69498 via svnmerge fromMark Dickinson2009-02-101-2/+2
| | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r69498 | mark.dickinson | 2009-02-10 15:46:50 +0000 (Tue, 10 Feb 2009) | 6 lines Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError for negative arguments. Previously, it raised TypeError. Thanks Lisandro Dalcin. ........
* Merged revisions 68112,68115,68120,68133,68141-68142,68145-68146,68148-68149 ↵Georg Brandl2009-01-031-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r68112 | benjamin.peterson | 2009-01-01 00:48:39 +0100 (Thu, 01 Jan 2009) | 1 line #4795 inspect.isgeneratorfunction() should return False instead of None ........ r68115 | benjamin.peterson | 2009-01-01 05:04:41 +0100 (Thu, 01 Jan 2009) | 1 line simplfy code ........ r68120 | georg.brandl | 2009-01-01 13:15:31 +0100 (Thu, 01 Jan 2009) | 4 lines #4228: Pack negative values the same way as 2.4 in struct's L format. ........ r68133 | antoine.pitrou | 2009-01-01 16:38:03 +0100 (Thu, 01 Jan 2009) | 1 line fill in actual issue number in tests ........ r68141 | benjamin.peterson | 2009-01-01 17:43:12 +0100 (Thu, 01 Jan 2009) | 1 line fix highlighting ........ r68142 | benjamin.peterson | 2009-01-01 18:29:49 +0100 (Thu, 01 Jan 2009) | 2 lines welcome to 2009, Python! ........ r68145 | amaury.forgeotdarc | 2009-01-02 01:03:54 +0100 (Fri, 02 Jan 2009) | 5 lines #4801 _collections module fails to build on cygwin. _PyObject_GC_TRACK is the macro version of PyObject_GC_Track, and according to documentation it should not be used for extension modules. ........ r68146 | ronald.oussoren | 2009-01-02 11:44:46 +0100 (Fri, 02 Jan 2009) | 2 lines Fix for issue4472: "configure --enable-shared doesn't work on OSX" ........ r68148 | ronald.oussoren | 2009-01-02 11:48:31 +0100 (Fri, 02 Jan 2009) | 2 lines Forgot to add a NEWS item in my previous checkin ........ r68149 | ronald.oussoren | 2009-01-02 11:50:48 +0100 (Fri, 02 Jan 2009) | 2 lines Fix for issue4780 ........
* Merged revisions 66321 via svnmerge fromBrett Cannon2008-09-091-2/+2
| | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r66321 | brett.cannon | 2008-09-08 17:49:16 -0700 (Mon, 08 Sep 2008) | 7 lines warnings.catch_warnings() now returns a list or None instead of the custom WarningsRecorder object. This makes the API simpler to use as no special object must be learned. Closes issue 3781. Review by Benjamin Peterson. ........
* Make test.test_support.catch_warnings more robust as discussed on ↵Nick Coghlan2008-07-131-7/+4
| | | | python-dev. Also add explicit tests for it to test_warnings. (forward port of r64910 from trunk)
* Another merge error, seen on bigendian machinesAmaury Forgeot d'Arc2008-06-171-1/+1
|
* Merged revisions ↵Amaury Forgeot d'Arc2008-06-171-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 64119,64147,64150,64165,64219-64221,64229-64230,64233,64235,64253,64278,64280,64301,64303,64320,64328,64338-64339 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r64119 | andrew.kuchling | 2008-06-11 14:53:14 +0200 (mer., 11 juin 2008) | 1 line Note PEP 371 section ........ r64147 | benjamin.peterson | 2008-06-11 22:04:30 +0200 (mer., 11 juin 2008) | 2 lines update ACKS and NEWs for multiprocessing ........ r64150 | georg.brandl | 2008-06-11 22:28:06 +0200 (mer., 11 juin 2008) | 2 lines Can we agree to put dots at entry ends? Thanks. ........ r64165 | armin.rigo | 2008-06-12 11:50:58 +0200 (jeu., 12 juin 2008) | 3 lines Sounds obvious, but I didn't even realize that you can put non-string keys in type dictionaries without using this locals() hack. ........ r64219 | neal.norwitz | 2008-06-13 08:00:46 +0200 (ven., 13 juin 2008) | 1 line Check for memory alloc failure ........ r64220 | neal.norwitz | 2008-06-13 08:02:26 +0200 (ven., 13 juin 2008) | 3 lines Fix some memory dealloc problems when exceptions occur. It caused: "Fatal Python error: UNREF invalid object" in the DoubleTest. ........ r64221 | neal.norwitz | 2008-06-13 08:03:25 +0200 (ven., 13 juin 2008) | 3 lines Fix typo in method name. The LT class implemented less than. The LE class should implement less than or equal to (as the code does). ........ r64229 | georg.brandl | 2008-06-13 15:26:54 +0200 (ven., 13 juin 2008) | 2 lines Clarification. ........ r64230 | robert.schuppenies | 2008-06-13 15:29:37 +0200 (ven., 13 juin 2008) | 2 lines Fixed: sys.getsizeof does not take the actual length of the tuples into account. ........ r64233 | benjamin.peterson | 2008-06-13 17:11:50 +0200 (ven., 13 juin 2008) | 2 lines platform.uname now tries to fill empty values even when os.uname is present ........ r64235 | benjamin.peterson | 2008-06-13 17:41:09 +0200 (ven., 13 juin 2008) | 1 line set svn:ignore on multiprocessing ........ r64253 | andrew.kuchling | 2008-06-13 21:38:18 +0200 (ven., 13 juin 2008) | 1 line Typo fixes ........ r64278 | martin.v.loewis | 2008-06-14 16:24:47 +0200 (sam., 14 juin 2008) | 2 lines Disable UAC by default. ........ r64280 | gregory.p.smith | 2008-06-14 19:34:09 +0200 (sam., 14 juin 2008) | 3 lines silence the test when it is skipped on some platforms. should fix a buildbot. ........ r64301 | georg.brandl | 2008-06-15 21:54:36 +0200 (dim., 15 juin 2008) | 2 lines Forward-port new test from r64300. ........ r64303 | raymond.hettinger | 2008-06-16 03:42:40 +0200 (lun., 16 juin 2008) | 1 line Issue 3116: fix quadratic behavior in marshal.dumps(). ........ r64320 | georg.brandl | 2008-06-16 23:00:47 +0200 (lun., 16 juin 2008) | 2 lines Add Jesse Noller to the developers list. ........ r64328 | georg.brandl | 2008-06-17 11:01:35 +0200 (mar., 17 juin 2008) | 2 lines Split the HTML index. ........ r64338 | vinay.sajip | 2008-06-17 13:02:14 +0200 (mar., 17 juin 2008) | 1 line Bug #3126: StreamHandler and FileHandler check before calling "flush" and "close" that the stream object has these, using hasattr (thanks to bobf for the patch). ........ r64339 | vinay.sajip | 2008-06-17 13:04:02 +0200 (mar., 17 juin 2008) | 1 line Updated with fix for #3126. ........
* Merged revisions ↵Amaury Forgeot d'Arc2008-06-171-637/+535
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 64089,64098,64100-64102,64113,64115-64116,64118,64120,64132,64342 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r64089 | armin.ronacher | 2008-06-10 22:37:02 +0200 (mar., 10 juin 2008) | 3 lines Fix a formatting error in the ast documentation. ........ r64098 | raymond.hettinger | 2008-06-11 02:25:29 +0200 (mer., 11 juin 2008) | 6 lines Mini-PEP: Simplifying numbers.py * Convert binary methods in Integral to mixin methods * Remove three-arg __pow__ as a required method * Make __int__ the root method instead of __long__. ........ r64100 | raymond.hettinger | 2008-06-11 02:28:51 +0200 (mer., 11 juin 2008) | 1 line Update numbers doc for the Integral simplification. ........ r64101 | raymond.hettinger | 2008-06-11 02:44:47 +0200 (mer., 11 juin 2008) | 3 lines Handle the case with zero arguments. ........ r64102 | benjamin.peterson | 2008-06-11 03:31:28 +0200 (mer., 11 juin 2008) | 4 lines convert test_struct to a unittest thanks to Giampaolo Rodola I had to disable one test because it was functioning incorrectly, see #1530559 I also removed the debugging prints ........ r64113 | thomas.heller | 2008-06-11 09:10:43 +0200 (mer., 11 juin 2008) | 2 lines Fix markup. Document the new 'offset' parameter for the 'ctypes.byref' function. ........ r64115 | raymond.hettinger | 2008-06-11 12:30:54 +0200 (mer., 11 juin 2008) | 1 line Multi-arg form for set.difference() and set.difference_update(). ........ r64116 | raymond.hettinger | 2008-06-11 14:06:49 +0200 (mer., 11 juin 2008) | 1 line Issue 3051: Let heapq work with either __lt__ or __le__. ........ r64118 | raymond.hettinger | 2008-06-11 14:39:09 +0200 (mer., 11 juin 2008) | 1 line Optimize previous checkin for heapq. ........ r64120 | raymond.hettinger | 2008-06-11 15:14:50 +0200 (mer., 11 juin 2008) | 1 line Add test for heapq using both __lt__ and __le__. ........ r64132 | gregory.p.smith | 2008-06-11 20:00:52 +0200 (mer., 11 juin 2008) | 3 lines Correct an incorrect comment about our #include of stddef.h. (see Doug Evans' comment on python-dev 2008-06-10) ........ r64342 | guido.van.rossum | 2008-06-17 19:38:02 +0200 (mar., 17 juin 2008) | 3 lines Roll back Raymond's -r64098 while we think of something better. (See issue 3056 -- we're close to a resolution but need unittests.) ........
* #2621 rename test.test_support to test.supportBenjamin Peterson2008-05-201-3/+3
|