summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* Add rsplit method for str and unicode builtin types.Hye-Shik Chang2003-12-151-0/+20
| | | | | SF feature request #801847. Original patch is written by Sean Reifschneider.
* SF patch 852995: add processors feature to urllib2Jeremy Hylton2003-12-141-29/+614
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | John J. Lee writes: "the patch makes it possible to implement functionality like HTTP cookie handling, Refresh handling, etc. etc. using handler objects. At the moment urllib2's handler objects aren't quite up to the job, which results in a lot of cut-n-paste and subclassing. I believe the changes are backwards-compatible, with the exception of people who've reimplemented build_opener()'s functionality -- those people would need to call opener.add_handler(HTTPErrorProcessor). The main change is allowing handlers to implement methods like: http_request(request) http_response(request, response) In addition to the usual http_open(request) http_error{_*}(...) " Note that the change isn't well documented at least in part because handlers aren't well documented at all. Need to fix this. Add a bunch of new tests. It appears that none of these tests actually use the network, so they don't need to be guarded by a resource flag.
* SF #736962, port test_future to unittest, add a bit more coverage, by Walter ↵Neal Norwitz2003-12-1311-47/+101
| | | | Dörwald
* Add tests to test_weakref.py to bring code coverage in _weakref.c up to 100%.Walter Dörwald2003-12-113-27/+54
| | | | | | | | Port test_md5.py to PyUnit. (Written by Neal Norwitz; from SF patch 736962) (Backport candidate)
* Move list and tuple tests from test_types.py to their own scripts:Walter Dörwald2003-12-087-514/+696
| | | | | | test_tuple.py and test_list.py. Common tests for tuple, list and UserList are shared (in seq_tests.py and list_tests.py). Port tests to PyUnit. (From SF patch #736962)
* Implement itertools.groupby()Raymond Hettinger2003-12-061-1/+107
| | | | | | | Original idea by Guido van Rossum. Idea for skipable inner iterators by Raymond Hettinger. Idea for argument order and identity function default by Alex Martelli. Implementation by Hye-Shik Chang (with tweaks by Raymond Hettinger).
* Remove extra copy of test_key_with_exception that somehow appearedMichael W. Hudson2003-12-041-7/+0
| | | | during a CVS merge.
* Fixes and tests for various "holding pointers when arbitrary Python codeMichael W. Hudson2003-12-041-0/+45
| | | | | | can run" bugs as discussed in [ 848856 ] couple of new list.sort bugs
* Typo repair; added some comments and horizontal whitespace.Tim Peters2003-12-041-9/+10
|
* Fix test_unicode_file errors on platforms without Unicode file support,Mark Hammond2003-12-032-19/+27
| | | | | by setting TESTFN_UNICODE_UNENCODEABLE on these platforms. test_unicode_file only attempts to use the name for testing if not None.
* Add parameters indent, width and depth to pprint.pprint() and pprint.pformat()Walter Dörwald2003-12-031-0/+6
| | | | and pass them along to the PrettyPrinter constructor.
* Patch #750542: pprint now will pretty print subclasses of list, tupleWalter Dörwald2003-12-031-4/+39
| | | | and dict too, as long as they don't overwrite __repr__().
* Reduce the size of Big String and Big Binary tests to 2**14 (minus oneGuido van Rossum2003-12-031-2/+2
| | | | | | | for Big String). This should make the tests pass on Win98SE. Note that the docs only promise lengths up to 2048. Unfortunately this no longer tests for the segfault I was seeing earlier, but I'm confident I've nailed that one. :-) Fixes SF 852281. Will backport to 2.3.
* Add test for bug "[ 846133 ] os.chmod/os.utime/shutil do not work withMark Hammond2003-12-032-78/+148
| | | | | | | unicode filenames" Reorganize tests into functions so more combinations of unicode/encoded/ascii can be tested, and while I was at it, upgrade to unittest based test.
* Add TESTFN_UNICODE_UNENCODEABLE, a unicode filename that can not beMark Hammond2003-12-031-0/+21
| | | | encoded using the default file system encoding.
* As discussed on python-dev, added two extractor functions to theRaymond Hettinger2003-12-011-0/+39
| | | | operator module.
* Add testcases for _winreg segfault (SF 851056).Guido van Rossum2003-11-301-1/+3
|
* Fix a bug discovered by Kalle Svensson: comparing sys.maxint toGuido van Rossum2003-11-291-1/+1
| | | | 2**32-1 makes no sense. Use 2**31-1 instead.
* - Removed FutureWarnings related to hex/oct literals and conversionsGuido van Rossum2003-11-295-58/+49
| | | | | | | | | | and left shifts. (Thanks to Kalle Svensson for SF patch 849227.) This addresses most of the remaining semantic changes promised by PEP 237, except for repr() of a long, which still shows the trailing 'L'. The PEP appears to promise warnings for operations that changed semantics compared to Python 2.3, but this is not implemented; we've suffered through enough warnings related to hex/oct literals and I think it's best to be silent now.
* Make sure the list.sort's decorate step unwinds itself before returningRaymond Hettinger2003-11-281-0/+7
| | | | | an exception raised by the key function. (Suggested by Michael Hudson.)
* Add optional fillchar argument to ljust(), rjust(), and center() string methods.Raymond Hettinger2003-11-261-3/+3
|
* * Checkin remaining documentationRaymond Hettinger2003-11-241-14/+59
| | | | | | | * Add more tests * Refactor and neaten the code a bit. * Rename union_update() to update(). * Improve the algorithms (making them a closer to sets.py).
* test_guess_all_types(): Use a more robust test for checking thatBarry Warsaw2003-11-231-4/+7
| | | | | | | | | | guess_all_extensions() returns (at least) what we expect. As Jeff Epler suggests in http://mail.python.org/pipermail/python-dev/2003-September/038264.html We use a set to test the results. This fixes the test when test_urllib2 is run before test_mimetypes.
* * Simplify hash function and add test to show effectiveness of the hashRaymond Hettinger2003-11-231-13/+72
| | | | | | | | | | | | | | | function. * Add a better test for deepcopying. * Add tests to show the __init__() function works like it does for list and tuple. Add related test. * Have shallow copies of frozensets return self. Add related test. * Have frozenset(f) return f if f is already a frozenset. Add related test. * Beefed-up some existing tests.
* Extend temporary hashability to remove() and discard().Raymond Hettinger2003-11-221-0/+10
| | | | Brings the functionality back in line with sets.py.
* Allow temporary hashability for the __contains__ test.Raymond Hettinger2003-11-211-0/+2
| | | | (Requested by Alex Martelli.)
* issubset() and issuperset() to work with general iterablesRaymond Hettinger2003-11-211-0/+4
|
* test_applesingle is an expected skip almost anywhere.Guido van Rossum2003-11-201-29/+40
|
* SF bug 839548: Bug in type's GC handling causes segfaults.Tim Peters2003-11-201-0/+205
| | | | | | | | Also SF patch 843455. This is a critical bugfix. I'll backport to 2.3 maint, but not beyond that. The bugs this fixes have been there since weakrefs were introduced.
* test_applesingle is an expected skip on Win32Raymond Hettinger2003-11-201-0/+1
|
* Fix for [ 765456 ]: testAFakeZlib failed on platforms that use aJust van Rossum2003-11-181-0/+7
| | | | | statically linked zlib module, but since the problem it tests can't exist on these systems, simply skip it then. Will backport.
* Test the applesingle decoder.Jack Jansen2003-11-181-0/+72
|
* Various fixups (most suggested by Armin Rigo).Raymond Hettinger2003-11-171-0/+25
|
* * Migrate set() and frozenset() from the sandbox.Raymond Hettinger2003-11-1612-36/+1206
| | | | | | | | * Install the unittests, docs, newsitem, include file, and makefile update. * Exercise the new functions whereever sets.py was being used. Includes the docs for libfuncs.tex. Separate docs for the types are forthcoming.
* subtype_dealloc(): A more complete fix for critical bug 840829 +Tim Peters2003-11-131-0/+19
| | | | | | expanded the test case with a piece that needs the more-complete fix. I'll backport this to 2.3 maint.
* Patch #839877: Remove unused lambda expression.Martin v. Löwis2003-11-131-4/+0
|
* SF bug 840829: weakref callbacks and gc corrupt memory.Tim Peters2003-11-121-0/+20
| | | | | | | | | | | | | | | | | subtype_dealloc(): This left the dying object exposed to gc, so that if cyclic gc triggered during the weakref callback, gc tried to delete the dying object a second time. That's a disaster. subtype_dealloc() had a (I hope!) unique problem here, as every normal dealloc routine untracks the object (from gc) before fiddling with weakrefs etc. But subtype_dealloc has obscure technical reasons for re-registering the dying object with gc (already explained in a large comment block at the bottom of the function). The fix amounts to simply refraining from reregistering the dying object with gc until after the weakref callback (if any) has been called. This is a critical bug (hard to predict, and causes seemingly random memory corruption when it occurs). I'll backport it to 2.3 later.
* Improve the implementation of itertools.tee().Raymond Hettinger2003-11-121-24/+31
| | | | | | | | | | | Formerly, underlying queue was implemented in terms of two lists. The new queue is a series of singly-linked fixed length lists. The new implementation runs much faster, supports multi-way tees, and allows tees of tees without additional memory costs. The root ideas for this structure were contributed by Andrew Koenig and Guido van Rossum.
* Update test to handle list.__reversed__().Raymond Hettinger2003-11-081-0/+1
|
* Convert heapq.py to a C implementation.Raymond Hettinger2003-11-081-1/+0
|
* Overallocate target buffer for normalization more early. Fixes #834676.Martin v. Löwis2003-11-061-0/+3
| | | | Backported to 2.3.
* Implement and apply PEP 322, reverse iterationRaymond Hettinger2003-11-061-1/+19
|
* * Use weakref's of DBCursor objects for the iterator cursors to avoid aGregory P. Smith2003-11-031-3/+76
| | | | | | | | | | memory leak that would've occurred for all iterators that were destroyed before having iterated until they raised StopIteration. * Simplify some code. * Add new test cases to check for the memleak and ensure that mixing iteration with modification of the values for existing keys works.
* * Fix the singlethreaded deadlocks occurring in the simple bsddb interface.Gregory P. Smith2003-11-021-1/+52
| | | | | * Add support for multiple iterator/generator objects at once on the simple bsddb _DBWithCursor interface.
* Patch #830858: Correct the number of is-functions. Backported to 2.3 and 2.2.Martin v. Löwis2003-10-311-0/+4
|
* Update test to include "sorted" in dir(list).Raymond Hettinger2003-10-291-1/+2
|
* Add list.sorted() classmethod.Raymond Hettinger2003-10-291-0/+58
|
* Deleting cyclic object comparison.Armin Rigo2003-10-284-69/+43
| | | | | SF patch 825639 http://mail.python.org/pipermail/python-dev/2003-October/039445.html
* Replace the window() example with pairwise() which demonstrates tee().Raymond Hettinger2003-10-261-13/+10
|
* Minor improvements to itertools.tee():Raymond Hettinger2003-10-261-0/+12
| | | | | | * tee object is no longer subclassable * independent iterators renamed to "itertools.tee_iterator" * fixed doc string typo and added entry in the module doc string