summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* Make test_coercion.py less sensitive to platform fp quirks. ClosesNeil Schemenauer2004-03-102-333/+348
| | | | SF bug #678265.
* Tidied up the implementations of reversed (including the custom onesRaymond Hettinger2004-03-101-2/+2
| | | | | | | | | | | | | | | | | for xrange and list objects). * list.__reversed__ now checks the length of the sequence object before calling PyList_GET_ITEM() because the mutable could have changed length. * all three implementations are now tranparent with respect to length and maintain the invariant len(it) == len(list(it)) even when the underlying sequence mutates. * __builtin__.reversed() now frees the underlying sequence as soon as the iterator is exhausted. * the code paths were rearranged so that the most common paths do not require a jump.
* Eliminate the double reverse option. It's only use caseRaymond Hettinger2004-03-101-4/+1
| | | | was academic and it was potentially confusing to use.
* SF #904720: dict.update should take a 2-tuple sequence like dict.__init_Raymond Hettinger2004-03-043-11/+15
| | | | | | | | (Championed by Bob Ippolito.) The update() method for mappings now accepts all the same argument forms as the dict() constructor. This includes item lists and/or keyword arguments.
* Have strftime() check its time tuple argument to make sure the tuple's valuesBrett Cannon2004-03-022-1/+57
| | | | | | | | | | are within proper boundaries as specified in the docs. This can break possible code (datetime module needed changing, for instance) that uses 0 for values that need to be greater 1 or greater (month, day, and day of year). Fixes bug #897625.
* Replace left(), right(), and __reversed__() with the more general purposeRaymond Hettinger2004-03-011-9/+34
| | | | | | | __getitem__() and __setitem__(). Simplifies the API, reduces the code size, adds flexibility, and makes deques work with bisect.bisect(), random.shuffle(), and random.sample().
* Cleanup: remove test file after it is used.Neal Norwitz2004-02-291-0/+1
|
* Improvements to collections.deque():Raymond Hettinger2004-02-291-3/+89
| | | | | | | | * Add doctests for the examples in the library reference. * Add two methods, left() and right(), modeled after deques in C++ STL. * Apply the new method to asynchat.py. * Add comparison operators to make deques more substitutable for lists. * Replace the LookupErrors with IndexErrors to more closely match lists.
* Fix two bugs in the new do_open() implementation for HTTPHandler.Jeremy Hylton2004-02-241-1/+2
| | | | | | | | | Invoke the standard error handlers for non-200 responses. Always supply a "Connection: close" header to prevent the server from leaving the connection open. Downstream users of the socket may attempt recv()/read() with no arguments, which would block if the connection were kept open.
* adding passing test. testing for g(*Nothing()) where Nothing is a ↵Samuele Pedroni2004-02-212-0/+26
| | | | user-defined iterator.
* Socket handler closed prior to end of test.Vinay Sajip2004-02-201-0/+1
|
* Get test to work when run from regrtest (add test_main), remove all CRs (^M)sNeal Norwitz2004-02-191-3/+5
|
* Implementation of patch 869468David Ascher2004-02-181-0/+159
| | | | | | | | | | | | | | | Allow the user to create Tkinter.Tcl objects which are just like Tkinter.Tk objects except that they do not initialize Tk. This is useful in circumstances where the script is being run on machines that do not have an X server running -- in those cases, Tk initialization fails, even if no window is ever created. Includes documentation change and tests. Tested on Linux, Solaris and Windows. Reviewed by Martin von Loewis.
* further testing indicates that the simplified version of the testFred Drake2004-02-131-4/+6
| | | | | | | | | | (re-using an existing test object class) no longer triggered the original segfault when the fix was backed out; restoring the local test object class to make the test effective the assignment of the ref created at the end does not affect the test, since the segfault happended before weakref.ref() returned; removing the assignment
* use existing test object instead of defining a new classFred Drake2004-02-121-5/+3
|
* Replace backticks with repr() or "%r"Walter Dörwald2004-02-1228-86/+86
| | | | From SF patch #852334.
* Fix indentation error in testGetServByName and rewrite loop to avoid clumsySkip Montanaro2004-02-101-5/+2
| | | | sentinel variable
* Make reversed() transparent with respect to length.Raymond Hettinger2004-02-101-0/+4
|
* Give itertools.repeat() a length method.Raymond Hettinger2004-02-101-1/+7
|
* Let reversed() work with itself.Raymond Hettinger2004-02-081-0/+4
|
* Make deque.rotate() smarter. Beef-up related tests.Raymond Hettinger2004-02-081-9/+43
|
* Patch #868499, adds -T option for code coverage. The implementation is aBarry Warsaw2004-02-071-30/+51
| | | | | | fairly simpleminded adaptation of Zope3's test.py -T flag. I also changed some booleans to use True/False where appropriate.
* * Incorporate Skip's suggestions for documentation (explain the word dequeRaymond Hettinger2004-02-071-0/+12
| | | | | comes from and show the differences from lists). * Add a rotate() method.
* * Fix ref counting in extend() and extendleft().Raymond Hettinger2004-02-071-0/+4
| | | | * Let deques support reversed().
* Have deques support high volume loads.Raymond Hettinger2004-02-061-0/+12
|
* Fix test failure message (from SF patch #885008)Walter Dörwald2004-02-061-1/+1
|
* Fix reallocation bug in unicode.translate(): The code was comparingWalter Dörwald2004-02-051-0/+1
| | | | characters instead of character pointers to determine space requirements.
* Allocating a new weakref object can cause existing weakref objects forFred Drake2004-02-041-0/+32
| | | | | | | | | the same object to be collected by the cyclic GC support if they are only referenced by a cycle. If the weakref being collected was one of the weakrefs without callbacks, some local variables for the constructor became invalid and have to be re-computed. The test caused a segfault under a debug build without the fix applied.
* - add tests that exercise fixes for the PyWeakref_NewRef() andFred Drake2004-02-031-0/+41
| | | | | PyWeakref_NewProxy() constructors from the C API - elaborate the getweakrefcount() and getweakrefs() tests slightly
* Fix input() builtin function to respect compiler flags.Hye-Shik Chang2004-02-021-0/+13
| | | | (SF patch 876178, patch by mwh, unittest by perky)
* * Move collections.deque() in from the sandboxRaymond Hettinger2004-01-292-17/+337
| | | | | | * Add unittests, newsitem, and whatsnew * Apply to Queue.py mutex.py threading.py pydoc.py and shlex.py * Docs are forthcoming
* Add a Guido inspired example for groupby().Raymond Hettinger2004-01-201-0/+14
|
* Test not the standard utf-8 codec but gb18030 which is the most complexHye-Shik Chang2004-01-201-4/+4
| | | | codec in multibytecodec consumers.
* For whatever reason, these files had \r\r\n line endings on Windows,Tim Peters2004-01-181-8/+8
| | | | | meaning they must have been checked in to CVS from a Linuxish box with Windowish \r\n line endings to begin with.
* Whitespace normalization.Tim Peters2004-01-1825-55/+43
|
* Add CJK codecs support as discussed on python-dev. (SF #873597)Hye-Shik Chang2004-01-1712-9/+1820
| | | | | Several style fixes are suggested by Martin v. Loewis and Marc-Andre Lemburg. Thanks!
* SF Patch #864863: Bisect C implementationRaymond Hettinger2004-01-051-15/+12
| | | | (Contributed by Dmitry Vasiliev.)
* [SF #866875] Add a specialized routine for one characterHye-Shik Chang2004-01-051-14/+55
| | | | separaters on str.split() and str.rsplit().
* Exercise sorted() where possibleRaymond Hettinger2004-01-041-3/+1
|
* More complete code coverage, including testing the new RFC 3548 support.Barry Warsaw2004-01-041-26/+181
|
* The script now takes an optional command-line argument to specify how manyAlex Martelli2004-01-021-4/+19
| | | | loops to run (default remains 50,000 if no argument is specified).
* Strengthen the test for hash effectivenessRaymond Hettinger2003-12-311-4/+4
|
* As part of fixing bug #829532, add a test case that exercises os.makedirsAndrew M. Kuchling2003-12-231-1/+36
|
* Fix unicode.rsplit()'s bug that ignores separater on the end of string whenHye-Shik Chang2003-12-231-0/+2
| | | | using specialized splitter for 1 char sep.
* Enable some unittests on FreeBSD.Hye-Shik Chang2003-12-192-3/+7
| | | | | test__locale: add typical POSIX-style full locale names. test_locale: use en_US.US-ASCII on FreeBSD.
* Remove methods that are no longer called by urllib2.Jeremy Hylton2003-12-171-14/+0
|
* Guido grants a Christmas wish:Raymond Hettinger2003-12-176-70/+47
| | | | sorted() becomes a regular function instead of a classmethod.
* Add methods to MockHTTPClass for modern httplib interface.Jeremy Hylton2003-12-171-51/+77
| | | | Replace lots of assert_(x == y) with assertEqual(x, y).
* 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.