summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* Generalize dictionary() to accept a sequence of 2-sequences. At theTim Peters2001-10-261-8/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | outer level, the iterator protocol is used for memory-efficiency (the outer sequence may be very large if fully materialized); at the inner level, PySequence_Fast() is used for time-efficiency (these should always be sequences of length 2). dictobject.c, new functions PyDict_{Merge,Update}FromSeq2. These are wholly analogous to PyDict_{Merge,Update}, but process a sequence-of-2- sequences argument instead of a mapping object. For now, I left these functions file static, so no corresponding doc changes. It's tempting to change dict.update() to allow a sequence-of-2-seqs argument too. Also changed the name of dictionary's keyword argument from "mapping" to "x". Got a better name? "mapping_or_sequence_of_pairs" isn't attractive, although more so than "mosop" <wink>. abstract.h, abstract.tex: Added new PySequence_Fast_GET_SIZE function, much faster than going thru the all-purpose PySequence_Size. libfuncs.tex: - Document dictionary(). - Fiddle tuple() and list() to admit that their argument is optional. - The long-winded repetitions of "a sequence, a container that supports iteration, or an iterator object" is getting to be a PITA. Many months ago I suggested factoring this out into "iterable object", where the definition of that could include being explicit about generators too (as is, I'm not sure a reader outside of PythonLabs could guess that "an iterator object" includes a generator call). - Please check my curly braces -- I'm going blind <0.9 wink>. abstract.c, PySequence_Tuple(): When PyObject_GetIter() fails, leave its error msg alone now (the msg it produces has improved since PySequence_Tuple was generalized to accept iterable objects, and PySequence_Tuple was also stomping on the msg in cases it shouldn't have even before PyObject_GetIter grew a better msg).
* Allow assignment to newinstance.__dict__.Guido van Rossum2001-10-261-0/+26
|
* A fix for SF bug #472560, extra newlines returned by get_param() whenBarry Warsaw2001-10-252-0/+50
| | | | | | | | the separating semi-colon shows up on a continuation line (legal, but weird). Bug reported and fixed by Matthew Cowles. Test case and sample email included.
* Applying proposed patch for bug #474583, optional support forBarry Warsaw2001-10-251-0/+12
| | | | | | | | | | | | | | | | | | | non-standard but common types. Including Martin's suggestion to add rejected non-standard types from patch #438790. Specifically, guess_type(), guess_extension(): Both the functions and the methods grow an optional "strict" flag, defaulting to true, which determines whether to recognize non-standard, but commonly found types or not. Also, I sorted, reformatted, and culled duplicates from the big types_map dictionary. Note that there are a few non-equivalent duplicates (e.g. .cdf and .xls) for which the first will just get thrown away. I didn't remove those though. Finally, use of the module as a script as grown the -l and -e options to toggle strictness and to do guess_extension(), respectively. Doc and unittest updates too.
* Ignore the posixfile deprecation warning for the test suite.Fred Drake2001-10-251-0/+3
|
* SF patch #474590 -- RISC OS supportGuido van Rossum2001-10-2415-70/+118
|
* test_curses is an expected skip on Linux too.Guido van Rossum2001-10-231-0/+1
|
* Record that test_curses doesn't run on win32.Tim Peters2001-10-221-0/+1
|
* Fixed denial-of-weak-ref-support test; Jeremy changed the error messageFred Drake2001-10-221-1/+1
| | | | | | used by the weakref code since he didn't like the word "referencable". Is it really necessary to be more specific than to test for TypeError here, though?
* Patch #473187: Add a test script that exercises most of the functions inAndrew M. Kuchling2001-10-222-1/+214
| | | | | the curses module. It's not run automatically; '-u curses' must be specified as an argument to regrtest
* sre.split should return the last segment, even if emptyFredrik Lundh2001-10-221-0/+1
| | | | (sorry, barry)
* Fix for SF bug #472940: can't getattr() attribute shown by dir()Guido van Rossum2001-10-221-5/+5
| | | | | | | | | | There really isn't a good reason for instance method objects to have their own __dict__, __doc__ and __name__ properties that just delegate the request to the function (callable); the default attribute behavior already does this. The test suite had to be fixed because the error changes from TypeError to AttributeError.
* Methods of built-in types now properly check for keyword argumentsGuido van Rossum2001-10-221-0/+9
| | | | | (formerly these were silently ignored). The only built-in methods that take keyword arguments are __call__, __init__ and __new__.
* sre.Scanner fixes (from Greg Chapman). also added a Scanner sanityFredrik Lundh2001-10-211-0/+20
| | | | | | check to the test suite. added a few missing exception checks in the _sre module
* added tests for long ints and ints where they are > 32 bits.Skip Montanaro2001-10-191-0/+14
| | | | should have been checked in as part of patch #470254.
* Additional test and documentation for the unicode() changes.Marc-André Lemburg2001-10-192-21/+62
| | | | This patch should also be applied to the 2.2b1 trunk.
* Another merge from mimelib:Barry Warsaw2001-10-191-0/+27
| | | | | TestMIMEMessage.test_epilogue(), TestIdempotent.test_preamble_epilogue(): Test cases for SF bug #472481.
* Another email package test fileBarry Warsaw2001-10-191-0/+22
|
* Assume a 64-bit start and len if O_LARGEFILE is available.Martin v. Löwis2001-10-181-1/+8
|
* Whitespace normalization.Tim Peters2001-10-189-12/+8
|
* The assignment to result.st_rdev can raise AttributeError as well asGuido van Rossum2001-10-181-1/+1
| | | | | TypeError (on systems where it's not defined at all, it raises AttributeError; when it's defined, assignment to it raises TypeError).
* SF patch #462296: Add attributes to os.stat results; by Nick Mathewson.Guido van Rossum2001-10-181-2/+119
| | | | | | | | | | | | | | | | | This is a big one, touching lots of files. Some of the platforms aren't tested yet. Briefly, this changes the return value of the os/posix functions stat(), fstat(), statvfs(), fstatvfs(), and the time functions localtime(), gmtime(), and strptime() from tuples into pseudo-sequences. When accessed as a sequence, they behave exactly as before. But they also have attributes like st_mtime or tm_year. The stat return value, moreover, has a few platform-specific attributes that are not available through the sequence interface (because everybody expects the sequence to have a fixed length, these couldn't be added there). If your platform's struct stat doesn't define st_blksize, st_blocks or st_rdev, they won't be accessible from Python either. (Still missing is a documentation update.)
* SF bug [#472347] pydoc and properties.Tim Peters2001-10-181-0/+31
| | | | | | | | | | | | | | | The GUI-mode code to display properties blew up if the property functions (get, set, etc) weren't simply methods (or functions). "The problem" here is really that the generic document() method dispatches to one of .doc{routine, class, module, other}(), but all of those require a different(!) number of arguments. Thus document isn't general-purpose at all: you have to know exactly what kind of thing is it you're going to document first, in order to pass the correct number of arguments to .document for it to pass on. As an expedient hack, just tacked "*ignored" on to the end of the formal argument lists for the .docXXX routines so that .document's caller doesn't have to know in advance which path .document is going to take.
* Do not expect line number events when running under "python -O".Fred Drake2001-10-181-0/+3
| | | | | The right fix is to generate line number events anyway ;-), but this will have to do for now.
* SRE bug #441409:Fredrik Lundh2001-10-181-0/+6
| | | | | | | | compile should raise error for non-strings SRE bug #432570, 448951: reset group after failed match also bumped version number to 2.2.0
* Add a test for calling a weakref proxy with a dictionary of keyword args.Fred Drake2001-10-181-0/+3
|
* Fix the frozen bytecode for __hello__ (betcha didn't know that existedGuido van Rossum2001-10-182-0/+30
| | | | | | | | | | :-). Add a test that prevents the __hello__ bytecode from going stale unnoticed again. The test also tests the loophole noted in SF bug #404545. This test will fail right now; I'll check in the fix in a minute.
* Make sure we do not core dump when using proxies with the binary slotFred Drake2001-10-181-0/+8
| | | | handlers. This was fixed in Objects/weakrefobject.c 1.2.
* Add test for local assigned to only in a nested list compJeremy Hylton2001-10-182-0/+19
|
* Fix SF bug #472234: type(obj) calls type->tp_init (Roeland Rengelink)Guido van Rossum2001-10-181-0/+12
| | | | | The fix is a band-aid: type_call() now makes the same exception for a single-argument call to type() as type_new() was already making.
* Add trivial test cases for RAND_add() and RAND_status().Jeremy Hylton2001-10-181-1/+15
| | | | (The rest of the test cases are trivial, so I don't feel too bad.)
* Two merges from the mimelib project:Barry Warsaw2001-10-171-0/+34
| | | | | | | | | test_no_semis_header_splitter(): This actually should still split. test_no_split_long_header(): An example of an unsplittable line. test_no_semis_header_splitter(): Test for SF bug # 471918, Generator splitting long headers.
* Make sure the output lists are sorted, even if run with -r.Jeremy Hylton2001-10-171-0/+6
|
* [ #403753 ] zlib decompress; uncontrollable memory usageJeremy Hylton2001-10-162-0/+33
| | | | | | | | | | | | | Mostly by Toby Dickenson and Titus Brown. Add an optional argument to a decompression object's decompress() method. The argument specifies the maximum length of the return value. If the uncompressed data exceeds this length, the excess data is stored as the unconsumed_tail attribute. (Not to be confused with unused_data, which is a separate issue.) Difference from SF patch: Default value for unconsumed_tail is "" rather than None. It's simpler if the attribute is always a string.
* SF bug [#468061] __str__ ignored in str subclass.Tim Peters2001-10-161-0/+31
| | | | | | | | | | | | | | | | | object.c, PyObject_Str: Don't try to optimize anything except exact string objects here; in particular, let str subclasses go thru tp_str, same as non-str objects. This allows overrides of tp_str to take effect. stringobject.c: + string_print (str's tp_print): If the argument isn't an exact string object, get one from PyObject_Str. + string_str (str's tp_str): Make a genuine-string copy of the object if it's of a proper str subclass type. str() applied to a str subclass that doesn't override __str__ ends up here. test_descr.py: New str_of_str_subclass() test.
* Remove obsolete __dynamic__ distinction.Tim Peters2001-10-151-126/+8
|
* Remove obsolete __dynamic__ distinction.Tim Peters2001-10-151-74/+1
|
* Remove obsolete __static__/__dynamic__ distinction.Tim Peters2001-10-151-11/+3
|
* Covert pickle tests to use unittest.Jeremy Hylton2001-10-155-193/+294
| | | | | Extend tests to cover a few more cases. For cPickle, test several of the undocumented features.
* Completely get rid of __dynamic__ and the correspondingGuido van Rossum2001-10-151-53/+21
| | | | | Py_TPFLAGS_DYNAMICTYPE bit. There is no longer a performance benefit, and I don't really see the use case any more.
* test_typed_subpart_iterator_default_type(): Test for when the messageBarry Warsaw2001-10-151-0/+18
| | | | has no Content-Type: header, it should be treated as text/plain.
* Remove some unused imports.Fred Drake2001-10-131-4/+17
| | | | | | Remove the log file after we are done with it. This should clean up after the test even on Windows, since the file is now closed before we attempt removal.
* You can't unlink open files on Windows.Tim Peters2001-10-131-1/+1
| | | | | | Simply commented it out, and then test_hotshot passes on Windows. Leaving to Fred to fix "the right way" (it seems to be a feature of unittest that all unittests try to unlink open files <wink>).
* A most trivial test for HotShot -- make sure we get reasonable eventsFred Drake2001-10-121-0/+81
| | | | reported and can read the log back in.
* SF bug [#470040] ParseTuple t# vs subclasses.Tim Peters2001-10-121-1/+32
| | | | | | | inherit_slots(): tp_as_buffer was getting inherited as if it were a method pointer, rather than a pointer to a vector of method pointers. As a result, inheriting from a type that implemented buffer methods was ineffective, leaving all the tp_as_buffer slots NULL in the subclass.
* Another step in the right direction: when a new class's attributeGuido van Rossum2001-10-111-16/+79
| | | | | | | | | corresponding to a dispatch slot (e.g. __getitem__ or __add__) is set, calculate the proper dispatch slot and propagate the change to all subclasses. Because of multiple inheritance, there's no easy way to avoid always recursing down the tree of subclasses. Who cares? (There's more to do, but this works. There's also a test for this now.)
* Add a test for the HeaderParser class.Barry Warsaw2001-10-111-1/+17
|
* Add test of hexlify on Unicode stringsJeremy Hylton2001-10-111-0/+4
|
* SF patch [ #468662 ] Allow jython to complete test_grammarJeremy Hylton2001-10-101-4/+14
| | | | | | The behavior of co_varnames in the presence of nested argument tuples is not consistent across Python and Jython. Test each platform separately.
* Add a bunch of tests for a list subclass that would have caught theGuido van Rossum2001-10-091-0/+22
| | | | previous embarrassment (typeobject.c checking crashing minidom).