summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_struct.py
Commit message (Collapse)AuthorAgeFilesLines
* Issue #22113: struct.pack_into() now supports new buffer protocol (inSerhiy Storchaka2015-02-211-5/+14
| | | | particular accepts writable memoryview).
* Issue #19099: The struct module now supports Unicode format strings.Serhiy Storchaka2013-12-081-0/+12
|
* fix issue referenceBenjamin Peterson2013-03-201-1/+1
|
* this obviously is not going to raise any -3 warningsBenjamin Peterson2013-03-201-9/+6
|
* Issue #10212: Support new buffer interface for struct.unpack andKristján Valur Jónsson2013-03-201-0/+11
| | | | cStringIO
* Issue #15467: Move helpers for __sizeof__ tests into test_support.Martin v. Löwis2012-07-291-31/+11
| | | | Patch by Serhiy Storchaka.
* Issue #15402: Simplify Struct.__sizeof__ and make tests more precise.Meador Inge2012-07-291-10/+42
|
* 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.
* Merged revisions 82777 via svnmerge fromBenjamin Peterson2010-07-101-2/+2
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r82777 | benjamin.peterson | 2010-07-10 10:14:45 -0500 (Sat, 10 Jul 2010) | 1 line ValueError is eventually what we want to move to, I suppose ........
* this makes checking for warnings less error proneBenjamin Peterson2010-07-091-3/+2
|
* Merged revisions 82739,82741 via svnmerge fromBenjamin Peterson2010-07-091-3/+4
| | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r82739 | benjamin.peterson | 2010-07-09 08:28:42 -0500 (Fri, 09 Jul 2010) | 1 line allow more exceptions ........ r82741 | benjamin.peterson | 2010-07-09 08:31:11 -0500 (Fri, 09 Jul 2010) | 1 line wrap ........
* Merged revisions 82735 via svnmerge fromBenjamin Peterson2010-07-091-1/+2
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r82735 | benjamin.peterson | 2010-07-09 08:20:40 -0500 (Fri, 09 Jul 2010) | 1 line OverflowError is fine ........
* 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 ........
* Fix possible undefined behaviour from signed overflow in struct module.Mark Dickinson2010-06-111-0/+6
| | | | Backport of revisions 81897, 81898 and 81902 from py3k.
* Issue #8300 (__index__ handling in struct.pack): Remove redundant checkMark Dickinson2010-04-041-10/+27
| | | | and improve test coverage. Thanks Meador Inge for the patch.
* Use more specific assert* methods in test_struct.Ezio Melotti2010-04-041-8/+8
|
* Issue #8300: Let struct.pack use __index__ to convert and pack non-integers.Mark Dickinson2010-04-031-0/+18
| | | | Based on a patch by Meador Inge.
* Cleanup test_struct using check_warnings.Florent Xicluna2010-03-201-68/+50
|
* Issue #1530559: When packing a non-integer with any integer conversionMark Dickinson2010-03-071-22/+47
| | | | | | | | | code using struct.pack, attempt to convert to an integer first using the argument's __int__ method (if present). Also raise a DeprecationWarning for any such usage of __int__. This fixes a regression from 2.6, where some (but not all) integer conversion codes already used __int__.
* Fix incorrect stacklevel for DeprecationWarnings originating from the struct ↵Mark Dickinson2010-03-051-36/+15
| | | | | | | module. Also clean up related tests in test_struct. The stacklevel fix should be backported to 2.6 once that branch is unfrozen.
* Remove unused imports in test modules.Georg Brandl2010-02-071-1/+1
|
* Reverting the Revision: 77368. I committed Flox's big patch for tests bySenthil Kumaran2010-01-081-6/+2
| | | | mistake. ( It may come in for sure tough)
* Fixing - Issue7026 - RuntimeError: dictionary changed size during iteration. ↵Senthil Kumaran2010-01-081-2/+6
| | | | Patch by flox
* Issue #1523: Remove deprecated overflow masking in struct module, andMark Dickinson2009-07-071-19/+1
| | | | make sure that out-of-range values consistently raise struct.error.
* Expand test coverage for struct.pack with native integer packing;Mark Dickinson2009-07-071-170/+107
| | | | reorganize the test_struct module to remove duplicated code and tests.
* Add skipping to struct test that only applies when overflow masking is in effectMark Dickinson2009-07-071-0/+2
|
* Issues #1530559, #1741130: Fix various inconsistencies in struct.packMark Dickinson2009-07-051-25/+26
| | | | integer packing, and reenable some previously broken tests.
* convert usage of fail* to assert*Benjamin Peterson2009-06-301-2/+2
|
* The unittest.TestCase.assertEqual() now displays the differences in lists,Gregory P. Smith2009-03-311-0/+1
| | | | | | | | | | 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.
* #3694: add test for fix committed in r66693.Georg Brandl2009-02-131-0/+4
|
* Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError forMark Dickinson2009-02-101-2/+2
| | | | | | negative arguments. Previously, it raised TypeError. Thanks Lisandro Dalcin.
* #4228: Pack negative values the same way as 2.4Georg Brandl2009-01-011-0/+7
| | | | in struct's L format.
* warnings.catch_warnings() now returns a list or None instead of the customBrett Cannon2008-09-091-2/+2
| | | | | | | | WarningsRecorder object. This makes the API simpler to use as no special object must be learned. Closes issue 3781. Review by Benjamin Peterson.
* Fix bug 3625: test issues on 64bit windows. r=pitrouMark Hammond2008-08-231-1/+1
|
* Make test.test_support.catch_warnings more robust as discussed on ↵Nick Coghlan2008-07-131-7/+4
| | | | python-dev. Also add explicit tests for itto test_warnings.
* silence the test when it is skipped on some platforms. should fix aGregory P. Smith2008-06-141-4/+2
| | | | buildbot.
* Merge in release25-maint r60793:Gregory P. Smith2008-06-111-0/+8
| | | | | | Added checks for integer overflows, contributed by Google. Some are only available if asserts are left in the code, in cases where they can't be triggered from Python code.
* convert test_struct to a unittest thanks to Giampaolo RodolaBenjamin Peterson2008-06-111-624/+524
| | | | | I had to disable one test because it was functioning incorrectly, see #1530559 I also removed the debugging prints
* Issue 705836: Fix struct.pack(">f", 1e40) to behave consistentlyMark Dickinson2008-03-141-1/+1
| | | | | | | | | | across platforms: it should now raise OverflowError on all platforms. (Previously it raised OverflowError only on non IEEE 754 platforms.) Also fix the (already existing) test for this behaviour so that it actually raises TestFailed instead of just referencing it.
* Issue 1872: Changed the struct module typecode from 't' to '?', forThomas Heller2008-03-051-14/+14
| | | | compatibility with PEP3118.
* Remove test.test_support.guard_warnings_filter.Brett Cannon2007-08-141-1/+1
| | | | | | | | test.test_support.catch_warning is more full-featured and provides the same functionality. Since guard_warnings_filter was added in 2.6 there is no backwards-compatibility issues.
* Bug #1563759: struct.unpack doens't support buffer protocol objectsRaymond Hettinger2007-04-051-0/+8
|
* Whitespace normalization.Tim Peters2007-01-301-49/+49
|
* Patch #1610575: Add support for _Bool to struct.Martin v. Löwis2007-01-211-7/+61
|
* Add test.test_support.guard_warnings_filter . This function returns a contextBrett Cannon2006-12-131-15/+10
| | | | | manager that protects warnings.filter from being modified once the context is exited.
* Fix #1530559, struct.pack raises TypeError where it used to convert.Bob Ippolito2006-08-041-26/+69
| | | | | Passing float arguments to struct.pack when integers are expected now triggers a DeprecationWarning.
* Access _struct attributes directly instead of mucking with getattr.Tim Peters2006-06-051-20/+18
| | | | | | | | | | string_reverse(): Simplify. assertRaises(): Raise TestFailed on failure. test_unpack_from(), test_pack_into(), test_pack_into_fn(): never use `assert` to test for an expected result (it doesn't test anything when Python is run with -O).
* Fixes in struct and socket from merge reviews.Martin Blais2006-06-041-13/+13
| | | | | | | | | | | | | - Following Guido's comments, renamed * pack_to -> pack_into * recv_buf -> recv_into * recvfrom_buf -> recvfrom_into - Made fixes to _struct.c according to Neal Norwitz comments on the checkins list. - Converted some ints into the appropriate -- I hope -- ssize_t and size_t.