summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* Port all string tests to PyUnit and share as much testsWalter Dörwald2003-02-216-935/+921
| | | | | | | between str, unicode, UserString and the string module as possible. This increases code coverage in stringobject.c from 83% to 86% and should help keep the string classes in sync in the future. From SF patch #662807
* SF bug #690083: test_random fails sometimesRaymond Hettinger2003-02-211-1/+1
| | | | | | time.sleep(1) sometimes delays for fractionally less than a second resulting in too short of an interval for C's time.time() function to create a distinct seed.
* Reverted whitespace normalization on this file. I should really changeTim Peters2003-02-191-9/+10
| | | | | this thing so it doesn't rely on being unnormalized. (That's the editorial "I", if anyone's listening <wink>.)
* Removed debugging print in test_tarfile.Tim Peters2003-02-191-1/+0
| | | | | In the Windows installer, continued the endless battle to copy over files with new one-shot extensions.
* Whitespace normalization.Tim Peters2003-02-1922-90/+86
|
* Use __reduce_ex__ in copy.py. The test_*copy_cant() tests are simpler again.Guido van Rossum2003-02-191-8/+24
|
* Three test cases for __reduce_ex__. This fails for cPickle, until TimGuido van Rossum2003-02-181-0/+52
| | | | checks in his changes to support this in cPickle.c.
* Introducing __reduce_ex__, which is called with a protocol number argumentGuido van Rossum2003-02-181-0/+1
| | | | | if it exists in preference over __reduce__. Now Tim can go implement this in cPickle.c.
* One doctest displaying a dict didn't sort it first. *Maybe* this fixesTim Peters2003-02-181-2/+2
| | | | the AIX problem with this test.
* Fix SF bug #688424, 64-bit test problemsNeal Norwitz2003-02-181-26/+71
|
* Fix SF bug #688424, 64-bit test problemsNeal Norwitz2003-02-182-3/+8
|
* SF patch #687683, Patches to logging (updates from Vinay)Neal Norwitz2003-02-182-12/+14
| | | | | | Mostly rename WARN -> WARNING Other misc tweaks Update tests (not in original patch)
* Make changes suggested by Walter to use self.assert*() methods.Neal Norwitz2003-02-171-26/+14
|
* Import test_support properlyNeal Norwitz2003-02-171-1/+1
|
* test_posix is an expected skip on Win32. Also fixed test_posix toTim Peters2003-02-172-1/+2
| | | | import from test.test_support instead of directly from test_support.
* Added test_posix (hopefully it works on Windows).Neal Norwitz2003-02-171-0/+172
| | | | | Remove PyArg_ParseTuple() for methods which take no args, use METH_NOARGS instead
* Use correct function name to PyArg_ParseTuple("is_package").Neal Norwitz2003-02-171-1/+4
| | | | | | | | | | | | Fix off-by-1 error in normalize_line_endings(): when *p == '\0' the NUL was copied into q and q was auto-incremented, the loop was broken out of, then a newline was appended followed by a NUL. So the function, in effect, was strcpy() but added two extra chars which was caught by obmalloc in debug mode, since there was only room for 1 additional newline. Get test working under regrtest (added test_main).
* Actually run these tests from regrtest.py.Neal Norwitz2003-02-176-10/+38
| | | | | | There was no test_main() and the main body was protected by if __name__ == '__main__' so the test didn't happen on import either.
* cPickle.c, load_build(): Taught cPickle how to pick apartTim Peters2003-02-152-8/+2
| | | | | | | | | | | | | | | | | | the optional proto 2 slot state. pickle.py, load_build(): CAUTION: Noted that cPickle's load_build and pickle's load_build really don't do the same things with the state, and didn't before this patch either. cPickle never tries to do .update(), and has no backoff if instance.__dict__ can't be retrieved. There are no tests that can tell the difference, and part of what cPickle's load_build() did looked accidental to me, so I don't know what the true intent is here. pickletester.py, test_pickle.py: Got rid of the hack for exempting cPickle from running some of the proto 2 tests. dictobject.c, PyDict_Next(): documented intended use.
* cPickle produces NEWOBJ appropriately now. It still doesn't knowTim Peters2003-02-141-6/+6
| | | | how to unpickle the new slot-full state tuples.
* - The audio driver tests (test_ossaudiodev.py andGuido van Rossum2003-02-143-0/+8
| | | | | | | test_linuxaudiodev.py) are no longer run by default. This is because they don't always work, depending on your hardware and software. To run these tests, you must use an invocation like ./python Lib/test/regrtest.py -u audio test_ossaudiodev
* Port test_charmapcodec to PyUnit. From SF patch #662807Walter Dörwald2003-02-142-44/+32
|
* - Finally fixed the bug in compile() and exec where a string endingGuido van Rossum2003-02-132-3/+13
| | | | | | | | | with an indented code block but no newline would raise SyntaxError. This would have been a four-line change in parsetok.c... Except codeop.py depends on this behavior, so a compilation flag had to be invented that causes the tokenizer to revert to the old behavior; this required extra changes to 2 .h files, 2 .c files, and 2 .py files. (Fixes SF bug #501622.)
* Removed unused cut'n'paste import.Tim Peters2003-02-131-1/+0
|
* We didn't have any tests making pickles with one of {pickle, cPickle},Tim Peters2003-02-132-0/+52
| | | | | | | and loading them via the other, except for the special cases of this Guido added to test_datetime.py for datetime module objects. The new test_xpickle.py tries all of pickletester's AbstractPickleTests in both x-module ways.
* Added a simple NEWOBJ test. This is in the pickle-only part of theTim Peters2003-02-131-0/+15
| | | | test for now (cPickle can't yet produce NEWOBJ).
* Remove filecmpAndrew M. Kuchling2003-02-131-1/+0
|
* Port test_userlist to PyUnit and add a few tests to increase codeWalter Dörwald2003-02-131-197/+257
| | | | coverage. From SF patch #662807
* SF patch #685738 by Michael Stone.Guido van Rossum2003-02-131-8/+8
| | | | | | | This changes the default __new__ to refuse arguments iff tp_init is the default __init__ implementation -- thus making it a TypeError when you try to pass arguments to a constructor if the class doesn't override at least __init__ or __new__.
* Re-enable compiling ossaudiodev now that it seems to work again.Guido van Rossum2003-02-131-1/+0
|
* Added a HIGHEST_PROTOCOL module attribute to pickle and cPickle.Tim Peters2003-02-131-2/+4
|
* SF patch #682432, add lookbehind testsNeal Norwitz2003-02-131-0/+7
|
* Fix typo.Walter Dörwald2003-02-121-1/+1
|
* Add test to ensure files (fds) don't leakNeal Norwitz2003-02-121-0/+6
|
* Cleanup from patch #683257:Neal Norwitz2003-02-121-0/+26
| | | | | | | Add missing INCREFs and re-indent returns to be consistent. Add \n\ for lines in docstring Add a pathetic test Add docs
* Expect test_ossaudiodev to skip on Linux, too. (It's broken.Guido van Rossum2003-02-121-0/+1
| | | | Volunteers wanted to fix it!)
* Systematic testing of hex/oct constants.Guido van Rossum2003-02-121-0/+81
|
* SF #660455 : patch by NNorwitz.Guido van Rossum2003-02-122-7/+12
| | | | | | | | | | "Unsigned" (i.e., positive-looking, but really negative) hex/oct constants with a leading minus sign are once again properly negated. The micro-optimization for negated numeric constants did the wrong thing for such hex/oct constants. The patch avoids the optimization for all hex/oct constants. This needs to be backported to Python 2.2!
* Implement another useful feature for proxies: in super(X, x), x mayGuido van Rossum2003-02-121-0/+39
| | | | now be a proxy for an X instance, as long as issubclass(x.__class__, X).
* SF #532767: isinstance(x, X) should work when x is a proxy for an XGuido van Rossum2003-02-121-1/+29
| | | | | instance, as long as x.__class__ is X or a subclass thereof. Did a little cleanup of PyObject_IsInstance() too.
* Implemented batching for dicts in cPickle. This is after two failedTim Peters2003-02-111-17/+17
| | | | | attempts to merge the C list-batch and dict-batch code -- they worked, but it was a godawful mess to read.
* Implemented list batching in cPickle.Tim Peters2003-02-111-17/+17
|
* Put proper tests in classmethod_get(). Remove the type argument toGuido van Rossum2003-02-111-0/+40
| | | | | | descr_check(); it wasn't useful. Change the type argument of the various _get() methods to PyObject * because the call signature of tp_descr_get doesn't guarantee its type.
* Added tests to ensure that list and dict "chunking" are actuallyTim Peters2003-02-111-1/+51
| | | | | | getting done. Since this isn't yet implemented in cPickle, the new tests are in TempAbstractPickleTests (which cPickle doesn't run).
* Get rid of the "bozo" __getstate__ that was inserted when __slots__Guido van Rossum2003-02-101-18/+17
| | | | | | was used. This simplifies some logic in copy_reg.py (used by pickling). It also broke a test, but this was rewritten to test the new feature. :-)
* Add a few tests to test_count() to increase coverage inWalter Dörwald2003-02-101-0/+6
| | | | Object/unicodeobject.c::unicode_count().
* Fix copy&paste error: call title instead of countWalter Dörwald2003-02-101-1/+1
|
* Change filtertuple() to use tp_as_sequence->sq_itemWalter Dörwald2003-02-101-2/+1
| | | | | instead of PyTuple_GetItem, so an overwritten __getitem__ in a tuple subclass works. SF bug #665835.
* Change filterstring() and filterunicode(): If theWalter Dörwald2003-02-101-13/+27
| | | | | | | | | | | | object is not a real str or unicode but an instance of a subclass, construct the output via looping over __getitem__. This guarantees that the result is the same for function==None and function==lambda x:x This doesn't happen for tuples, because filtertuple() uses PyTuple_GetItem(). (This was discussed on SF bug #665835).
* patch #683515: "Add unicode support to compile(), eval() and exec"Just van Rossum2003-02-101-0/+4
| | | | Incorporated nnorwitz's comment re. Py__USING_UNICODE.