summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_builtin.py
Commit message (Collapse)AuthorAgeFilesLines
* Guido grants a Christmas wish:Raymond Hettinger2003-12-171-2/+35
| | | | sorted() becomes a regular function instead of a classmethod.
* - Removed FutureWarnings related to hex/oct literals and conversionsGuido van Rossum2003-11-291-3/+2
| | | | | | | | | | 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.
* * Migrate set() and frozenset() from the sandbox.Raymond Hettinger2003-11-161-3/+2
| | | | | | | | * 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.
* Deleting cyclic object comparison.Armin Rigo2003-10-281-6/+6
| | | | | SF patch 825639 http://mail.python.org/pipermail/python-dev/2003-October/039445.html
* Make a copy of L before appending, so the global L remainsWalter Dörwald2003-08-151-4/+4
| | | | | | unchanged (and sys.gettotalrefcount() remains constant). Fix a few typos.
* As discussed on python-dev, changed builtin.zip() to handle zero argumentsRaymond Hettinger2003-08-021-1/+2
| | | | by returning an empty list instead of raising a TypeError.
* Port test_complex.py to unittest.Walter Dörwald2003-06-181-56/+0
| | | | | | | | Move the constructor tests from test_builtin to test_complex. Add a bunch of tests (code coverage is a 94%). From SF patch #736962.
* Used sets.Set() to compare unordered sequences.Raymond Hettinger2003-05-021-11/+3
| | | | Improves clarity and brevity.
* Combine the functionality of test_support.run_unittest()Walter Dörwald2003-05-011-3/+1
| | | | | | | | | | and test_support.run_classtests() into run_unittest() and use it wherever possible. Also don't use "from test.test_support import ...", but "from test import test_support" in a few spots. From SF patch #662807.
* Adding new built-in function sum, with docs and tests.Alex Martelli2003-04-221-0/+21
|
* Add a few errors tests for range().Walter Dörwald2003-04-151-0/+6
|
* test_range(): The C code changed to raise TypeError in one of theseTim Peters2003-04-151-1/+1
| | | | cases, but the test still expected ValueError. Repaired that.
* Patch by Chad Netzer (with significant change):Guido van Rossum2003-04-111-0/+35
| | | | | | | - range() now works even if the arguments are longs with magnitude larger than sys.maxint, as long as the total length of the sequence fits. E.g., range(2**100, 2**101, 2**100) is the following list: [1267650600228229401496703205376L]. (SF patch #707427.)
* Whitespace normalization.Tim Peters2003-02-191-15/+15
|
* 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.
* patch 680474 that fixes bug 679880: compile/eval/exec refused utf-8 bomJust van Rossum2003-02-091-0/+4
| | | | mark. Added unit test.
* Make sure filter() never returns tuple, str or unicodeWalter Dörwald2003-02-041-0/+23
| | | | subclasses. (Discussed in SF patch #665835)
* Add a test that checks that filter() honors the sq_item slot forWalter Dörwald2003-02-041-0/+13
| | | | | str and unicode subclasses not just for generating the output but for testing too.
* filterstring() and filterunicode() in Python/bltinmodule.cWalter Dörwald2003-02-041-0/+21
| | | | | | | | | | | | | blindly assumed that tp_as_sequence->sq_item always returns a str or unicode object. This might fail with str or unicode subclasses. This patch checks whether the object returned from __getitem__ is a str/unicode object and raises a TypeError if not (and the filter function returned true). Furthermore the result for __getitem__ can be more than one character long, so checks for enough memory have to be done.
* Fix SF bug# 676155, RuntimeWarning with tp_compareNeal Norwitz2003-01-281-0/+1
| | | | Check return value of PyLong_AsDouble(), it can return an error.
* Fix comment typosWalter Dörwald2003-01-271-3/+4
|
* Patch #636005: Filter unicode into unicode.Martin v. Löwis2003-01-251-0/+6
|
* Combine test_b1.py and test_b2.py into test_builtin.py,Walter Dörwald2003-01-191-9/+1075
| | | | | | | | port the tests to PyUnit and add many tests for error cases. This increases code coverage in Python/bltinmodule.c from 75% to 92%. (From SF patch #662807, with assert_(not fcmp(x, y)) replaced with assertAlmostEqual(x, y) where possible)
* Complete the absolute import patch for the test suite. All relativeBarry Warsaw2002-07-301-3/+3
| | | | | | | | imports of test modules now import from the test package. Other related oddities are also fixed (like DeprecationWarning filters that weren't specifying the full import part, etc.). Also did a general code cleanup to remove all "from test.test_support import *"'s. Other from...import *'s weren't changed.
* Initial revisionGuido van Rossum1992-01-271-0/+13