summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_builtin.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix tests now that the callable warning is gone.Ezio Melotti2011-11-061-1/+0
|
* Close #12501: Adjust callable() warning: callable() is only not supported inVictor Stinner2011-07-081-0/+1
| | | | Python 3.1. callable() is again supported in Python 3.2.
* #11565: Fix several typos. Patch by Piotr Kasprzyk.Ezio Melotti2011-03-161-1/+1
|
* Merged revisions 86596 via svnmerge fromEzio Melotti2010-11-211-7/+7
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line #9424: Replace deprecated assert* methods in the Python test suite. ........
* Issue #8816: Extra tests for some built-in functions. These tests areMark Dickinson2010-05-251-14/+69
| | | | ports of IronPython tests. Thanks Gregory Nofi.
* Issue #1533: test_range in test_builtin: fix test comment and add testMark Dickinson2010-05-051-2/+2
| | | | for rejection of small floats. Thanks Alexander Belopolsky.
* Issue #1533: fix inconsistency in range function argument processing:Mark Dickinson2010-05-041-0/+50
| | | | | | | | | any non-float non-integer argument is now converted to an integer (if possible) using its __int__ method. Previously, only small arguments were treated this way; larger arguments (those whose __int__ was outside the range of a C long) would produce a TypeError. Patch by Alexander Belopolsky (with minor modifications).
* Issue 7994: Make object.__format__ with a non-empty format string a ↵Eric Smith2010-04-021-0/+36
| | | | PendingDecprecationWarning. Still need to remove uses of this from various tests.
* #7092 - Silence more py3k deprecation warnings, using ↵Florent Xicluna2010-03-211-9/+14
| | | | test_support.check_py3k_warnings() helper.
* Remove unused imports in test modules.Georg Brandl2010-02-071-3/+3
|
* use assert[Not]In where appropriateEzio Melotti2010-01-231-14/+14
|
* Reverting the Revision: 77368. I committed Flox's big patch for tests bySenthil Kumaran2010-01-081-20/+7
| | | | mistake. ( It may come in for sure tough)
* Fixing - Issue7026 - RuntimeError: dictionary changed size during iteration. ↵Senthil Kumaran2010-01-081-7/+20
| | | | Patch by flox
* Issue #7251: Break out round tests for large values into a separateMark Dickinson2009-11-091-3/+22
| | | | | | | test function, and skip that test on Linux/alpha systems with a broken system round function. This should turn the Debian/alpha buildbot green.
* Make sure every run of test_intern() interns a new string, otherwise that ↵Georg Brandl2009-10-271-1/+4
| | | | test fails e.g. when some other test in test_builtin fails and it is rerun in verbose mode.
* Protect against attempts to replace PyNumber_Add with PyNumber_InPlaceAdd in ↵Mark Dickinson2009-10-171-0/+4
| | | | builtin sum
* Issue #6540: Fixed crash for bytearray.translate() with invalid parameters.Georg Brandl2009-07-221-0/+5
|
* convert usage of fail* to assert*Benjamin Peterson2009-06-301-42/+42
|
* Issue #1869: Fix a couple of minor round() issues.Mark Dickinson2009-04-181-0/+3
|
* Issue 2235: Py3k warnings are now emitted for classes that will no longer ↵Nick Coghlan2008-08-111-0/+1
| | | | inherit a__hash__ implementation from a parent class in Python 3.x. The standard library and test suite have been updated to not emit these warnings.
* #3479: unichr(2**32) used to return u'\x00'.Amaury Forgeot d'Arc2008-07-311-0/+1
| | | | | | The argument was fetched in a long, but PyUnicode_FromOrdinal takes an int. (why doesn't gcc issue a truncation warning in this case?)
* Revert 64424, 64438, and 64439.Raymond Hettinger2008-06-241-27/+0
|
* Issue 3008: hex/oct/bin can show floats exactly.Raymond Hettinger2008-06-211-0/+27
|
* revert 63425 over Guido's Febuary message about this, that I missedBenjamin Peterson2008-05-171-4/+0
|
* add Py3k warnings to oct and hex. backport hex behavior (because it's not ↵Benjamin Peterson2008-05-171-0/+4
| | | | different)
* #2196 hasattr now allows SystemExit and KeyboardInterrupt to propagateBenjamin Peterson2008-05-121-0/+10
|
* Moved testing of builtin types out of test_builtin and into type specific ↵Benjamin Peterson2008-05-031-692/+0
| | | | modules
* #2719: backport next() from 3k.Georg Brandl2008-04-301-0/+27
|
* Finished backporting PEP 3127, Integer Literal Support and Syntax.Eric Smith2008-03-171-0/+45
| | | | | | | | Added 0b and 0o literals to tokenizer. Modified PyOS_strtoul to support 0b and 0o inputs. Modified PyLong_FromString to support guessing 0b and 0o inputs. Renamed test_hexoct.py to test_int_literal.py and added binary tests. Added upper and lower case 0b, 0O, and 0X tests to test_int_literal.py
* Tests for bin() builtin. These need to get merged into py3k, which has no ↵Eric Smith2008-02-221-0/+9
| | | | tests for bin.
* Moved test_format into the correct TestCase.Eric Smith2008-02-211-39/+39
|
* Backport of PEP 3101, Advanced String Formatting, from py3k.Eric Smith2008-02-171-0/+95
| | | | | | | | | | | | | | | Highlights: - Adding PyObject_Format. - Adding string.Format class. - Adding __format__ for str, unicode, int, long, float, datetime. - Adding builtin format. - Adding ''.format and u''.format. - str/unicode fixups for formatters. The files in Objects/stringlib that implement PEP 3101 (stringdefs.h, unicodedefs.h, formatter.h, string_format.h) are identical in trunk and py3k. Any changes from here on should be made to trunk, and changes will propogate to py3k).
* Rename rational.Rational to fractions.Fraction, to avoid name clashMark Dickinson2008-02-101-2/+2
| | | | with numbers.Rational. See issue #1682 for related discussion.
* Make int() and long() fall back to __trunc__(). See issue 2002.Jeffrey Yasskin2008-02-041-0/+102
|
* Test round-trip on float.as_integer_ratio() and float.__truediv__().Raymond Hettinger2008-02-011-0/+6
|
* Issue #1996: float.as_integer_ratio() should return fraction in lowest terms.Raymond Hettinger2008-02-011-0/+8
|
* Move __builtins__.trunc() to math.trunc() perJeffrey Yasskin2008-02-011-32/+0
| | | | | http://mail.python.org/pipermail/python-dev/2008-January/076626.html and issue 1965.
* Moved Rational._binary_float_to_ratio() to float.as_integer_ratio() becauseJeffrey Yasskin2008-01-271-1/+20
| | | | | | | it's useful outside of rational numbers. This is my first C code that had to do anything significant. Please be more careful when looking over it.
* Fix #1679: "0x" was taken as a valid integer literal.Georg Brandl2008-01-191-0/+5
| | | | | Fixes the tokenizer, tokenize.py and int() to reject this. Patches by Malte Helmert.
* Continue rolling back pep-3141 changes that changed behavior from 2.5. ThisJeffrey Yasskin2008-01-051-13/+11
| | | | | | | | | | | | round included: * Revert round to its 2.6 behavior (half away from 0). * Because round, floor, and ceil always return float again, it's no longer necessary to have them delegate to __xxx___, so I've ripped that out of their implementations and the Real ABC. This also helps in implementing types that work in both 2.6 and 3.0: you return int from the __xxx__ methods, and let it get enabled by the version upgrade. * Make pow(-1, .5) raise a ValueError again.
* Patch #1725 by Mark Dickinson, fixes incorrect conversion of -1e1000Guido van Rossum2008-01-051-0/+6
| | | | and adds errors for -0x.
* Backport PEP 3141 from the py3k branch to the trunk. This includes r50877 (justJeffrey Yasskin2008-01-031-1/+74
| | | | | | | the complex_pow part), r56649, r56652, r56715, r57296, r57302, r57359, r57361, r57372, r57738, r57739, r58017, r58039, r58040, and r59390, and new documentation. The only significant difference is that round(x) returns a float to preserve backward-compatibility. See http://bugs.python.org/issue1689.
* Patch #1444529: the builtin compile() now accepts keyword arguments.Georg Brandl2007-03-131-0/+9
| | | | (backport)
* Backport from Py3k branch:Georg Brandl2007-03-121-4/+59
| | | | | | | Patch #1591665: implement the __dir__() special function lookup in PyObject_Dir. Had to change a few bits of the patch because classobjs and __methods__ are still in Py2.6.
* Patch #1638879: don't accept strings with embedded NUL bytes in long().Georg Brandl2007-03-061-0/+5
|
* Bug #1545497: when given an explicit base, int() did ignore NULsGeorg Brandl2006-10-121-0/+5
| | | | embedded in the string to convert.
* Forward-port of r52136,52138: a review of overflow-detecting code.Armin Rigo2006-10-041-2/+9
| | | | | | | | | | | | | | | | | | | | | | | * unified the way intobject, longobject and mystrtoul handle values around -sys.maxint-1. * in general, trying to entierely avoid overflows in any computation involving signed ints or longs is extremely involved. Fixed a few simple cases where a compiler might be too clever (but that's all guesswork). * more overflow checks against bad data in marshal.c. * 2.5 specific: fixed a number of places that were still confusing int and Py_ssize_t. Some of them could potentially have caused "real-world" breakage. * list.pop(x): fixing overflow issues on x was messy. I just reverted to PyArg_ParseTuple("n"), which does the right thing. (An obscure test was trying to give a Decimal to list.pop()... doesn't make sense any more IMHO) * trying to write a few tests...
* Fix integer negation and absolute value to not relyMartin v. Löwis2006-10-041-0/+1
| | | | | on undefined behaviour of the C compiler anymore. Will backport to 2.5 and 2.4.
* Fix and test for an infinite C recursion.Armin Rigo2006-08-091-0/+4
|
* __hash__ may now return long int; the final hashMartin v. Löwis2006-08-091-0/+9
| | | | | value is obtained by invoking hash on the long int. Fixes #1536021.