Commit Graph

15644 Commits

Author SHA1 Message Date
Benjamin Peterson 4dbda8593d spelling 2010-04-03 15:45:59 +00:00
Benjamin Peterson 7beeeb5713 silence PyCObject warnings in bsddb 2010-04-03 15:44:56 +00:00
Benjamin Peterson 7daf985feb remove unneeded argument 2010-04-03 15:40:29 +00:00
Benjamin Peterson 73541af85d wrap 2010-04-03 15:38:38 +00:00
Michael Foord 3dd9f40d6d Minor tweak to unittest command line usage message 2010-04-03 15:20:00 +00:00
Michael Foord d43b63fed3 Adding -b command line option to the unittest usage message. 2010-04-03 14:52:18 +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
Raymond Hettinger dd2fedcd1c Factor-out constant expressions 2010-04-03 07:57:09 +00:00
Raymond Hettinger 6b96ecb0ab Improve clear() method. Keeps key/value refcnts >= 1 until final dict.clear() so that decrefs to zero won't trigger arbitrary code . Also runs a bit faster. 2010-04-03 03:14:28 +00:00
Michael Foord 93232660bb Another attempt at a fix for unittest.test.test_result for windows line endings 2010-04-03 02:33:55 +00:00
Michael Foord 9b4ee12e89 Cross platform unittest.TestResult newline handling when buffering stdout / stderr. 2010-04-03 02:21:39 +00:00
Benjamin Peterson 1c7c11ef61 give TypeError when trying to set T_STRING_INPLACE 2010-04-03 01:28:57 +00:00
Michael Foord 931190b4f5 Support dotted module names for test discovery paths in unittest. Issue 7780. 2010-04-03 01:15:21 +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
Raymond Hettinger 3928276e64 Clear cyclical references in list based OrderedDict. 2010-04-03 00:39:26 +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
Michael Foord a04c7a0f16 Issue #8038: Addition of unittest.TestCase.assertNotRegexpMatches 2010-04-02 22:55:59 +00:00
Michael Foord 25d7976014 unittest tests no longer replace the sys.stdout put in place by regrtest 2010-04-02 22:30:56 +00:00
Mark Dickinson 7c63eee485 Issue #8294: Allow float and Decimal arguments in Fraction constructor. 2010-04-02 22:27:36 +00:00
Michael Foord 58c1e78806 TestResult stores original sys.stdout and tests no longer use sys.__stdout__ (etc) in tests for unittest -b command line option 2010-04-02 22:08:29 +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
Michael Foord 5637f04a94 Addition of -b command line option to unittest for buffering stdout and stderr during test runs. 2010-04-02 21:42:47 +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
Tarek Ziadé ef253ac84e removed the local copy of xxmodule, and skip only test_build_ext when xxmodule is not found, not the whole unittest 2010-04-02 21:14:04 +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
Andrew M. Kuchling d54e699cba #4440: modernize a use of filter(), making it compatible with 3.x 2010-04-02 16:59:16 +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
Florent Xicluna a7f242fa2a #7092: Drop the cmp argument. 2010-04-02 08:15:26 +00:00
Florent Xicluna d630c04ab1 #7092: Fix additional "-3" warnings in the idlelib package, and convert to absolute imports. 2010-04-02 07:24:52 +00:00
Florent Xicluna 8d1da0f5c3 #7092: Fix some -3 warnings, and fix Lib/platform.py when the path contains a double-quote. 2010-04-01 18:17:09 +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
Brian Curtin a01da93d85 Fix a test_pydoc failure on Neal Norwitz's buildbot. 2010-04-01 04:02:00 +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
Barry Warsaw f7f2d6f51e - Issue #8233: When run as a script, py_compile.py optionally takes a single
argument `-` which tells it to read files to compile from stdin.  Each line
  is read on demand and the named file is compiled immediately.  (Original
  patch by Piotr Ożarowski).
2010-03-31 21:07:16 +00:00
Brian Curtin fe4900c0bc Correct what was intended to be a single-tuple to just be a != check.
Thanks to Éric Araujo for noticing that.
2010-03-31 17:36:09 +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