summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_complex.py
Commit message (Collapse)AuthorAgeFilesLines
* Issue #8748: Fix incorrect results from comparisons between an integerMark Dickinson2010-05-301-1/+18
| | | | and a complex instance. Based on a patch by Meador Inge.
* Issue #5211: Complete removal of implicit coercions for the complexMark Dickinson2010-05-301-0/+13
| | | | | type. Coercion for arithmetic operations was already removed in r78280, but that commit didn't remove coercion for rich comparisons.
* Replace catch_warnings with check_warnings when it makes sense. Use ↵Florent Xicluna2010-03-311-13/+5
| | | | assertRaises context manager to simplify some tests.
* Issue #7988: Fix default alignment to be right aligned for ↵Eric Smith2010-02-221-0/+2
| | | | complex.__format__. Now it matches other numeric types.
* Issue #5211: Fix complex type to avoid implicit calls toMark Dickinson2010-02-211-0/+55
| | | | complex.__coerce__. Thanks Meador Inge for the patch.
* Remove e assertIs definitions and use correct assert* methods.Ezio Melotti2010-02-201-3/+0
|
* Issue #3382: Make '%F' and float.__format__('F') convert results to upper ↵Eric Smith2009-11-291-0/+19
| | | | case. Much of the patch came from Mark Dickinson.
* Issue #7117: Use PyOS_string_to_double instead of PyOS_ascii_strtod inMark Dickinson2009-10-261-1/+4
| | | | | complexobject.c. Also remove length restriction on unicode inputs to the complex constructor.
* convert usage of fail* to assert*Benjamin Peterson2009-06-301-5/+5
|
* Issue #5829: don't raise OverflowError for complex('1e500'). Backport of ↵Mark Dickinson2009-05-201-0/+7
| | | | r72803.
* Issue #5920: Changed format.__float__ and complex.__float__ to use a ↵Eric Smith2009-05-051-0/+10
| | | | precision of 12 when using the empty presentation type. This more closely matches str()'s behavior and reduces surprises when adding alignment flags to an empty format string. Patch by Mark Dickinson.
* Issue #1588: Add complex.__format__.Eric Smith2009-04-301-1/+60
|
* Fix typo in complex parsing code; expand tests.Mark Dickinson2009-04-251-3/+19
|
* Issue #5816:Mark Dickinson2009-04-241-10/+66
| | | | | | | | - simplify parsing and printing of complex numbers - make complex(repr(z)) round-tripping work for complex numbers involving nans, infs, or negative zeros - don't accept some of the stranger complex strings that were previously allowed---e.g., complex('1..1j')
* Fixed complex.__getnewargs__() to not emit another complex object.Alexandre Vassalotti2008-06-041-0/+8
|
* Fixed repr() and str() of complex numbers. Complex suffered from the same ↵Christian Heimes2008-02-151-0/+14
| | | | problem as floats but I forgot to test and fix them.
* Issue #1678380. Fix a bug that identifies 0j and -0j when they appearMark Dickinson2008-01-311-0/+7
| | | | | in the same code unit. The fix is essentially the same as the fix for a previous bug identifying 0. and -0.
* Patch # 1507 by Mark Dickinson. Make complex(x, -0) retain the sign ofGuido van Rossum2007-11-271-0/+13
| | | | | the imaginary part (as long as it's not complex). Backport candidate?
* Patch #1491866: change the complex() constructor to allow parthensized ↵Collin Winter2007-03-091-0/+12
| | | | forms. This means complex(repr(x)) now works instead of raising a ValueError.
* Test case for latest complexobject fix.Georg Brandl2005-09-171-0/+2
|
* Make subclasses of int, long, complex, float, and unicode perform typeBrett Cannon2005-04-261-0/+22
| | | | | | | conversion using the proper magic slot (e.g., __int__()). Also move conversion code out of PyNumber_*() functions in the C API into the nb_* function. Applied patch #1109424. Thanks Walter Doewald.
* Fix repr for negative imaginary part. Fixes #1013908.Martin v. Löwis2004-08-221-0/+1
|
* Remove useless import.Walter Dörwald2003-08-051-1/+1
|
* Check both __div__ and __truediv__ in division tests.Walter Dörwald2003-08-051-1/+9
| | | | (From SF patch #543867)
* Add various test cases from SF patch 543867.Walter Dörwald2003-07-151-1/+58
|
* Whitespace normalization.Tim Peters2003-06-291-1/+1
|
* Port test_complex.py to unittest.Walter Dörwald2003-06-181-89/+249
| | | | | | | | Move the constructor tests from test_builtin to test_complex. Add a bunch of tests (code coverage is a 94%). From SF patch #736962.
* Complete the absolute import patch for the test suite. All relativeBarry Warsaw2002-07-301-1/+1
| | | | | | | | 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.
* test_support: add a docstring to vereq().Tim Peters2001-12-291-2/+1
| | | | test_complex: repair new test's usage of vereq().
* SF Patch #497487 add test to compare conjugate of a complex numberNeal Norwitz2001-12-291-1/+4
|
* SF Patch #494873 add tests for complex numbers including calls to int()/long()Neal Norwitz2001-12-291-0/+21
|
* Add a comment explaining what these tests are for, and where to look forFred Drake2001-12-131-0/+3
| | | | tests of complex().
* Reverting to rev 1.2. Apparently gcc doesn't use the extended-precisionTim Peters2001-09-061-3/+16
| | | | | | | | capabilities of the Pentium FPU, so what should have been (and were on Windows) exact results got fuzzy. Then it turns out test_support.fcmp() isn't tolerant of tiny errors when *one* of the comparands is 0, but test_complex's old check_close_real() is. Rather than fix gcc <wink>, easier to revert this test and revisit after the release.
* Rewrite to use test_support's fine fcmp instead -- I didn't know thatTim Peters2001-09-061-16/+3
| | | | existed when I wrote this test.
* This division test was too stringent in its accuracy expectations forTim Peters2001-05-291-4/+4
| | | | | | | random inputs: if you ran the test 100 times, you could expect it to report a bogus failure. So loosened its expectations. Also changed the way failing tests are printed, so that when run under regrtest.py we get enough info to reproduce the failure.
* SF bug [ #409448 ] Complex division is braindeadTim Peters2001-03-181-0/+65
http://sourceforge.net/tracker/?func=detail&aid=409448&group_id=5470&atid=105470 Now less braindead. Also added test_complex.py, which doesn't test much, but fails without this patch.