Raymond Hettinger
e1d665a90e
Classes that override __eq__ also need to define __hash__.
2010-04-05 18:53:43 +00:00
Mark Dickinson
5e0c2748fb
Use a more robust infinity check in _Py_HashDouble.
...
This fixes a test_decimal failure on FreeBSD 8.0. (modf apparently
doesn't follow C99 Annex F on FreeBSD.)
2010-04-05 18:07:51 +00:00
R. David Murray
0c08009708
Issue 8316: make test_gdb robust in the face of differing terminal
...
widths. Patch by Dave Malcolm.
2010-04-05 16:28:49 +00:00
Philip Jenvey
034b0acdd3
fix escape_encode to return the correct consumed size
2010-04-05 02:51:51 +00:00
Raymond Hettinger
06bc0b6d2e
Add tests for functools.total_ordering.
2010-04-04 22:24:03 +00:00
Raymond Hettinger
bb006cf26c
Add tests for cmp_to_key.
...
Adopt PEP 8 compliant function name.
Factor-out existing uses cmp_to_key.
Update documentation to use internal pointers instead of external resource.
2010-04-04 21:45:01 +00:00
Mark Dickinson
fdaaa9c9d8
Issue #8300 (__index__ handling in struct.pack): Remove redundant check
...
and improve test coverage. Thanks Meador Inge for the patch.
2010-04-04 08:43:04 +00:00
Ezio Melotti
a28eb1c429
Use more specific assert* methods in test_struct.
2010-04-04 07:00:02 +00:00
Raymond Hettinger
ab8b9cae7e
Expand test coverage for deque.count().
2010-04-03 22:34:15 +00:00
Benjamin Peterson
a44f393c93
import bsddb more robustly
2010-04-03 21:50:40 +00:00
Antoine Pitrou
47b1d02d85
Remove useless (?) import from r79706
2010-04-03 21:42:18 +00:00
Raymond Hettinger
5f516edd77
Add count() method to collections.deque().
2010-04-03 18:10:37 +00:00
Benjamin Peterson
0ccc7bbb34
stop CObject deprecation warnings in test___all__
2010-04-03 16:06:42 +00:00
Ezio Melotti
856a3be76a
Use more specific assert* methods in test_decimal.
2010-04-03 14:51:00 +00:00
Mark Dickinson
4846a8e828
Issue #8300 : Let struct.pack use __index__ to convert and pack non-integers.
...
Based on a patch by Meador Inge.
2010-04-03 14:05:10 +00:00
Mark Dickinson
b05dc00fb7
Fix a couple of issues with the test_structmembersType class in _testcapimodule
...
- rename to _test_structmembersType to avoid the class being automatically
called by test_capi
- allow space for trailing NUL in inplace_member field of all_structmembers
- use T_STRING_INPLACE instead of T_INPLACE_STRING as keyword argument
to _test_structmembersType initializer
- don't attempt to initialize inplace_member field if T_STRING_INPLACE
argument wasn't supplied.
2010-04-03 10:27:05 +00:00
Raymond Hettinger
34c35b2788
Add subtract() method to collections.Counter() objects.
2010-04-03 10:22:00 +00:00
Benjamin Peterson
1c7c11ef61
give TypeError when trying to set T_STRING_INPLACE
2010-04-03 01:28:57 +00:00
Benjamin Peterson
2b79fdfc69
split out large test function
2010-04-03 01:08:34 +00:00
Brian Curtin
e9da81c62b
Fix assertRaises usage on reflection functions which should raise
...
NotImplementedError on Windows XP and below.
2010-04-03 00:59:32 +00:00
Benjamin Peterson
4564c08b26
set svn:eol-style on new file
2010-04-02 23:31:40 +00:00
Brian Curtin
e5aa886b44
Implement #1220212 . Add os.kill support for Windows.
...
os.kill takes one of two newly added signals, CTRL_C_EVENT and
CTRL_BREAK_EVENT, or any integer value. The events are a special case
which work with subprocess console applications which implement a
special console control handler. Any other value but those two will
cause os.kill to use TerminateProcess, outright killing the process.
This change adds win_console_handler.py, which is a script to implement
SetConsoleCtrlHandler and applicable handler function, using ctypes.
subprocess also gets another attribute which is a necessary flag to
creationflags in Popen in order to send the CTRL events.
2010-04-02 23:26:06 +00:00
Mark Dickinson
7c63eee485
Issue #8294 : Allow float and Decimal arguments in Fraction constructor.
2010-04-02 22:27:36 +00:00
Ezio Melotti
7999deafc8
Fix test_compiler.py that was using unittest.__file__ to find Lib/ (unittest is now a package).
2010-04-02 21:43:10 +00:00
Brian Curtin
e33fa887d3
Implement #7347 . Add CreateKeyEx, DeleteKeyEx, and update _winreg tests.
...
*ReflectionKey functions used to not be documented or tested, but they are
now sufficiently documented and tested on platforms where they apply.
Additionally, fixed a bug in QueryReflectionKey which was returning an
incorrect value.
All tests pass from XP through Windows 7, on 32 and 64-bit platforms.
2010-04-02 21:18:14 +00:00
Raymond Hettinger
ed171abd93
Issue 8257: Decimal constructor to accept float.
2010-04-02 18:39:24 +00:00
Florent Xicluna
f37592fda1
Backport some robotparser test and skip the test if the external resource is not available.
2010-04-02 17:26:42 +00:00
Eric Smith
d44b2fc87c
Issue 7994: Make object.__format__ with a non-empty format string a PendingDecprecationWarning. Still need to remove uses of this from various tests.
2010-04-02 12:30:56 +00:00
Mark Dickinson
f3eeca16cb
Issue #7279 : Make Decimal('nan') hashable. Decimal('snan') remains unhashable.
...
Also rewrite the Decimal __hash__ method so that it doesn't rely on
float('inf') being valid: float('inf') could raise an exception on
platforms not using IEEE 754 arithmetic.
2010-04-02 10:35:12 +00:00
Mark Dickinson
e096e82e82
Issue #7279 : Make comparisons involving a Decimal sNaN signal InvalidOperation.
2010-04-02 10:17:07 +00:00
Mark Dickinson
99d8096c17
Issue #2531 : Make float-to-decimal comparisons return correct results.
...
Float to decimal comparison operations now return a result based on
the numeric values of the operands. Decimal.__hash__ has also been
fixed so that Decimal and float values that compare equal have equal
hash value.
2010-04-02 08:53:22 +00:00
Florent Xicluna
dfd3618422
#7092 : silence some py3k warnings
2010-04-02 08:30:21 +00:00
Antoine Pitrou
b5023df3d6
Issue #8281 : rename test_gdb_sample.py to gdb_sample.py, otherwise it gets picked
...
as a regular test by regrtest.py, and fails.
2010-04-01 17:56:57 +00:00
Martin v. Löwis
bf0dfb3d0e
Issue #8032 : For gdb7, a python-gdb.py file is added to the build,
...
allowing to use advanced gdb features when debugging Python.
2010-04-01 07:40:51 +00:00
Florent Xicluna
6257a7bbb2
Replace catch_warnings with check_warnings when it makes sense. Use assertRaises context manager to simplify some tests.
2010-03-31 22:01:03 +00:00
Antoine Pitrou
a57df2cf1d
Issue #8268 : Old-style classes (not just instances) now support weak
...
references.
2010-03-31 21:32:15 +00:00
Florent Xicluna
26cc99da2a
Fix test for xml.etree when using a non-ascii path. And use check_warnings instead of catch_warnings.
2010-03-31 21:21:54 +00:00
Ezio Melotti
fcc500ebc4
Silence a py3k warning.
2010-03-31 08:33:50 +00:00
Brian Curtin
aeb2e8295d
Fix #8225 . xml.etree was displaying an incorrect link when viewed in help.
2010-03-31 03:10:21 +00:00
Antoine Pitrou
8f66efe253
Fix small error in r79502
2010-03-30 18:58:22 +00:00
Antoine Pitrou
6032c25063
Issue #8248 : Add some tests for the bool type. Patch by Gregory Nofi.
2010-03-30 18:49:45 +00:00
Benjamin Peterson
7e213255ce
add inspect.getcallargs, which binds function arguments like a normal call #3135
...
Patch by George Sakkis
2010-03-30 17:58:13 +00:00
Florent Xicluna
75c6676916
#8263 : Now regrtest.py will report a failure if it receives a KeyboardInterrupt (SIGINT).
2010-03-30 16:31:14 +00:00
Florent Xicluna
22b243809e
#7643 : Unicode codepoints VT (0x0B) and FF (0x0C) are linebreaks according to Unicode Standard Annex #14 .
2010-03-30 08:24:06 +00:00
Michael Foord
e6410c536c
Backport of weakref.WeakSet and tests from Python 3.
2010-03-29 20:04:23 +00:00
Michael Foord
b35ecf4775
Rename the unittest test_suite function to not clash with a test module name (unittest.test.test_suite is now unambiguous).
2010-03-27 13:42:34 +00:00
Mark Dickinson
71b7fac07b
Make Fraction to complex comparisons with <=, <, >= or > raise TypeError.
2010-03-27 11:09:29 +00:00
Florent Xicluna
355adc5a45
Ensure that the failed or unexpected tests are sorted before printing.
2010-03-26 19:32:44 +00:00
Benjamin Peterson
c7024e7fd6
reorder imports
2010-03-26 13:53:32 +00:00
Michael Foord
35b3792ed3
Turn unittest tests into a package
2010-03-25 23:56:33 +00:00