Commit Graph

6689 Commits

Author SHA1 Message Date
Lars Gustäbel 12adc655c8 Add a testcase that checks if the TarFile constructor successfully
closes the internal file object in case of an error (issue #7341).
2009-11-23 15:46:19 +00:00
Lars Gustäbel dd866d57af Issue #6123: Fix opening empty archives and files.
(Note that an empty archive is not the same as an empty file. An
empty archive contains no members and is correctly terminated with an
EOF block full of zeros. An empty file contains no data at all.)

The problem was that although tarfile was able to create empty
archives, it failed to open them raising a ReadError. On the other
hand, tarfile opened empty files without error in most read modes and
presented them as empty archives. (However, some modes still raised
errors: "r|gz" raised ReadError, but "r:gz" worked, "r:bz2" even
raised EOFError.)

In order to get a more fine-grained control over the various internal
error conditions I now split up the HeaderError exception into a
number of meaningful sub-exceptions. This makes it easier in the
TarFile.next() method to react to the different conditions in the
correct way.

The visible change in its behaviour now is that tarfile will open
empty archives correctly and raise ReadError consistently for empty
files.
2009-11-22 18:30:53 +00:00
Jesse Noller 814d02dcd1 issue6615: Additional test for logging support in multiprocessing 2009-11-21 14:38:23 +00:00
Mark Dickinson c4920e86ef Issue #7272: Add configure test to detect whether sem_open works
properly, and use this to skip test_multiprocessing on platforms
where sem_open raises a signal.  This should fix some FreeBSD buildbot
failures for test_multiprocessing.
2009-11-20 19:30:22 +00:00
Benjamin Peterson 99a5023c80 improve several corner cases related with argument names in parenthesis
- Fix #7362: give a good error message for parenthesized arguments with
  defaults.

- Add a py3k warning for any parenthesized arguments since those are not allowed
  in Py3.  This warning is not given in tuple unpacking, since that incurs the
  tuple unpacking warning.
2009-11-19 22:54:57 +00:00
Benjamin Peterson dc3c239b1e #5037 proxy __unicode__ correctly 2009-11-19 03:00:02 +00:00
Mark Dickinson bd15a06fd3 Issue #7117, continued: Change round implementation to use the correctly-rounded
string <-> float conversions;  this makes sure that the result of the round
operation is correctly rounded, and hence displays nicely using the new float
repr.
2009-11-18 19:33:35 +00:00
Nick Coghlan 815521fca0 Correctly escape arbitrary error message text in the runpy unit tests 2009-11-18 11:27:53 +00:00
Nick Coghlan 4b953bac94 Allow for backslashes in file paths passed to the regex engine 2009-11-16 03:57:32 +00:00
Nick Coghlan 4976e3287a Account for another cache when hunting ref leaks 2009-11-16 03:55:51 +00:00
Antoine Pitrou ccd5e02d2b Issue #2054: ftplib now provides an FTP_TLS class to do secure FTP using
TLS or SSL.  Patch by Giampaolo Rodola'.
2009-11-15 17:22:09 +00:00
Antoine Pitrou d5b34d4597 Issue #4969: The mimetypes module now reads the MIME database from
the registry under Windows.  Patch by Gabriel Genellina.
2009-11-15 14:10:48 +00:00
Mark Dickinson 009ae861f2 Avoid signed overflow in some xrange calculations, and extend
xrange tests to cover some special cases that caused problems
in py3k.  This is a partial backport of r76292-76293 (see
issue #7298.)
2009-11-15 12:31:13 +00:00
Nick Coghlan 49868cb686 Issue #6816: expose the zipfile and directory execution mechanism to Python code via the runpy module. Also consolidated some script execution functionality in the test harness into a helper module and removed some implementation details from the runpy module documentation. 2009-11-15 07:30:34 +00:00
R. David Murray 4653b8c2de Remove 'g' from regrtest getopt argument string, since there's no
handler for it.
2009-11-15 00:07:00 +00:00
R. David Murray da82689daa Issue 7324: add a sanity check to regrtest argument parsing to
catch the case of an option with no handler.
2009-11-15 00:04:32 +00:00
R. David Murray 7f7eea651f Issue #7312 (new feature): Add a -F flag to run the selected tests in
a loop until a test fails.  Can be combined with -j.  Patch by Antoine
Pitrou.
2009-11-14 15:18:22 +00:00
Benjamin Peterson e36199b49d fix several compile() issues by translating newlines in the tokenizer 2009-11-12 23:39:44 +00:00
Antoine Pitrou 310c9fec1a Issue #7295: Do not use a hardcoded file name in test_tarfile. 2009-11-11 20:55:07 +00:00
Antoine Pitrou 0734c632d5 Issue #7197: Allow unittest.TextTestRunner objects to be pickled and
unpickled. This fixes crashes under Windows when trying to run
test_multiprocessing in verbose mode.

Additionally, Test_TextTestRunner hadn't been enabled in test_unittest.
2009-11-10 20:49:30 +00:00
Mark Dickinson c579b35740 Add extra information to a test_signal failure message to aid diagnosis of buildbot failure. 2009-11-09 19:54:51 +00:00
Mark Dickinson a8fd66d6aa Issue #7251: Break out round tests for large values into a separate
test function, and skip that test on Linux/alpha systems with a broken
system round function.

This should turn the Debian/alpha buildbot green.
2009-11-09 17:03:34 +00:00
Antoine Pitrou d7158d4c62 Issue #7282: Fix a memory leak when an RLock was used in a thread other
than those started through `threading.Thread` (for example, using
`thread.start_new_thread()`.
2009-11-09 16:00:11 +00:00
Antoine Pitrou 002533013f Kill a small potential leak in test_threading.
The leak may not manifest itself if the OS re-uses the same thread ids
(I suppose Neal's machine doesn't :-))
2009-11-08 00:24:12 +00:00
Nick Coghlan 2733d88dc2 Add test for runpy.run_module package execution and use something other than logging as the example of a non-executable package 2009-11-07 08:13:55 +00:00
Antoine Pitrou c98efe0500 Issue #7270: Add some dedicated unit tests for multi-thread synchronization
primitives such as Lock, RLock, Condition, Event and Semaphore.
2009-11-06 22:34:35 +00:00
Antoine Pitrou 323b9da16d Issue #7211: Allow 64-bit values for the `ident` and `data` fields of kevent
objects on 64-bit systems.  Patch by Michael Broghton.

I will revert this checkin if it causes problems on our BSD buildbots.
2009-11-04 19:25:14 +00:00
Antoine Pitrou 4ac6b93c00 Make test_shutil clean up after itself 2009-11-04 00:50:26 +00:00
Antoine Pitrou b3c169b08f Try to make test_wsgiref less fragile against environment changes by other tests 2009-11-03 16:41:20 +00:00
Antoine Pitrou c6714bd1df Add acceptance of long ints to test_memoryio.py
(in preparation for fix of #7249 in 2.6)
2009-11-02 20:47:33 +00:00
Benjamin Peterson 28e463d131 enable test_parser in lib2to3 2009-11-02 18:24:57 +00:00
Benjamin Peterson aed6c4556c add space 2009-11-02 18:16:36 +00:00
Antoine Pitrou d8b16ab288 Fix and improve some assertions in test_site 2009-11-01 23:54:20 +00:00
Antoine Pitrou 84ee9e257e Use a custom timeout in test_support.open_urlresource. 2009-11-01 22:02:03 +00:00
Antoine Pitrou e4c6b16b37 This should finally fix #6896. Let's watch the buildbots. 2009-11-01 21:29:33 +00:00
Antoine Pitrou 8844153d7f test_normalization should skip and not crash when the resource isn't available 2009-11-01 21:26:14 +00:00
Raymond Hettinger fa7dadd339 Fix exception handling in itertools.izip_longest(). 2009-11-01 20:45:16 +00:00
Antoine Pitrou 235d942391 Hum, test skipping when the URL isn't reachable hadn't been applied to trunk. 2009-11-01 16:10:47 +00:00
Antoine Pitrou 0da5cb8db6 Use richer assertions in test_mailbox (for better failure messages). 2009-10-31 23:19:52 +00:00
Eric Smith 0b9e3a5423 Improved test for a deprecation warning. 2009-10-31 17:07:17 +00:00
Mark Dickinson 4b841d9156 Issue #7042: Use a better mechanism for testing timers in test_signal. 2009-10-31 10:36:06 +00:00
Benjamin Peterson b2e31a1c63 add some checks for evaluation order with parenthesis #7210 2009-10-31 03:56:15 +00:00
Antoine Pitrou 161df94b0d Try to fix transient refleaks in test_pydoc. 2009-10-30 21:41:22 +00:00
Antoine Pitrou 3c96858480 Try to fix transient refleaks in test_xmlrpc. 2009-10-30 17:56:00 +00:00
Antoine Pitrou 643e85df48 Try to fix transient refleaks in test_asynchat. 2009-10-30 17:55:21 +00:00
Antoine Pitrou 61d5f6ff79 Fix transient refleaks in test_docxmlrpc. 2009-10-30 17:33:28 +00:00
Antoine Pitrou 59c44f36e0 Issue #7222: Make thread "reaping" more reliable so that reference
leak-chasing test runs give sensible results. The previous method of
reaping threads could return successfully while some Thread objects were
still referenced. This also introduces a new private function:
:func:hread._count().
2009-10-30 17:07:08 +00:00
Georg Brandl 93c2171494 Fix constant name. 2009-10-29 21:44:56 +00:00
Georg Brandl 4045e88b8b Use constants instead of magic integers for test result. Do not re-run with --verbose3 for environment changing tests. 2009-10-29 20:53:00 +00:00
Mark Dickinson 6f3900163a Issue #7233: Fix Decimal.shift and Decimal.rotate methods for
arguments with more digits than the current context precision.
Bug reported by Stefan Krah.
2009-10-29 12:11:18 +00:00
Mark Dickinson 0c67312c5c Issue #7233: A number of two-argument Decimal methods were failing to
accept ints and longs for the second argument.
2009-10-29 12:04:00 +00:00
Mark Dickinson 783b877555 Fix duplicate test numbers in extra.decTest 2009-10-29 11:09:09 +00:00
Benjamin Peterson ea0e3b0d60 do a backport of r75928
The added test does not fail without the patch, but we still fix the issue of
surrogates being used in wide builds where they should not be.
2009-10-29 01:49:07 +00:00
R. David Murray d913864efa Remove variable that is no longer used. 2009-10-28 14:03:43 +00:00
Georg Brandl 4e1be94bc6 Make sure every run of test_intern() interns a new string, otherwise that test fails e.g. when some other test in test_builtin fails and it is rerun in verbose mode. 2009-10-27 22:56:09 +00:00
Mark Dickinson 53e9fa4eed Test long inputs to float 2009-10-27 22:09:33 +00:00
Antoine Pitrou 8aea050911 Reduce the probability of refleaks in test_socketserver.
Not completely suppressed though, see issue #7222.
2009-10-27 21:27:24 +00:00
Tarek Ziadé d24cab8c74 Issue #7218: Fix test_site for win32 2009-10-27 21:20:27 +00:00
Benjamin Peterson 26a93c0082 test expect base classes 2009-10-27 20:59:18 +00:00
Georg Brandl 8319170abb Reformat the regrtest command-line option help and group the options into sections. 2009-10-27 20:55:44 +00:00
Georg Brandl 71a015ac1c Add a regrtest option to re-run in verbose mode immediately after a test fails, and use that option on the buildbots. 2009-10-27 20:52:02 +00:00
Antoine Pitrou cb170100d4 Try to fix transient refleaks in test_distutils. 2009-10-27 20:20:41 +00:00
Antoine Pitrou fce3207b53 Fix transient refleaks in test_urllib2_localnet. 2009-10-27 20:14:04 +00:00
Antoine Pitrou bb0bb30acc Suppress transient refleaks in test_threading. 2009-10-27 20:02:23 +00:00
Antoine Pitrou a763c06357 Suppress transient refleaks in test_smtplib. 2009-10-27 19:47:30 +00:00
Antoine Pitrou 0df2c73d6c Suppress transient refleaks in test_file2k. 2009-10-27 19:36:44 +00:00
Antoine Pitrou e171edc832 Fix transient refleak in test_sys. 2009-10-27 19:23:56 +00:00
Antoine Pitrou 85bd5879b2 (Hopefully) suppress transient refleaks in test_httpservers. 2009-10-27 18:50:52 +00:00
Antoine Pitrou f829d1f551 Suppress transient refleaks in test_asyncore 2009-10-27 18:36:47 +00:00
Antoine Pitrou dd62966a5f Issue #7205: Fix a possible deadlock when using a BZ2File object from several threads at once. 2009-10-27 17:41:58 +00:00
Benjamin Peterson 7582ec36b2 use 'is' instead of id() 2009-10-26 22:51:16 +00:00
Mark Dickinson c04c7c5b72 Issue #7117: Use PyOS_string_to_double instead of PyOS_ascii_strtod in
complexobject.c.  Also remove length restriction on unicode inputs to
the complex constructor.
2009-10-26 22:28:14 +00:00
Mark Dickinson 8568b19850 Issue #7117: Use PyOS_string_to_double instead of PyOS_ascii_strtod in
floatobject.c.  Also, remove limitation on length of unicode inputs to
float().
2009-10-26 21:11:20 +00:00
Mark Dickinson 828b39865a Skip readline tests if readline module is not available. 2009-10-26 11:59:30 +00:00
Mark Dickinson da8652d920 Issue #7117 (backport py3k float repr) continued:
Add sys.float_repr_style attribute ('short' if short float
repr is in used;  'legacy' otherwise).
2009-10-24 14:01:08 +00:00
Antoine Pitrou f7820c1626 Manual py3k backport: [svn r74316] Issue #5449: Fix io.BytesIO to not accept arbitrary keywords 2009-10-24 12:28:22 +00:00
Antoine Pitrou fa94e80f3b Manual py3k backport: [svn r74158] Issue #6218: Make io.BytesIO and io.StringIO picklable. 2009-10-24 12:23:18 +00:00
Antoine Pitrou f98a267be3 Manual py3k backport: [svn r74155] Issue #6242: Fix deallocator of io.StringIO and io.BytesIO 2009-10-24 11:59:41 +00:00
Antoine Pitrou b5cf8a059c Issue #7194: test_thread could try to release an unacquired mutex (and fail). 2009-10-23 18:32:15 +00:00
Antoine Pitrou b119ca9df4 Fix Windows buildbot failure 2009-10-23 12:01:13 +00:00
Antoine Pitrou 9bd246bba9 Test wouldn't work in debug mode.
We probably need a function in test_support to handle this.
2009-10-20 21:59:25 +00:00
Antoine Pitrou efb60c0ceb Issue #1722344: threading._shutdown() is now called in Py_Finalize(), which
fixes the problem of some exceptions being thrown at shutdown when the
interpreter is killed. Patch by Adam Olsen.
2009-10-20 21:29:37 +00:00
Mark Dickinson a7a52ab7ee Issue #7099: Decimal.is_normal should return True for all nonzero
finite non-subnormal values, even those with exponent > Emax.
2009-10-20 13:33:03 +00:00
Antoine Pitrou 5ba84910ae Issue #7133: SSL objects now support the new buffer API.
This fixes the test_ssl failure.
2009-10-19 17:59:07 +00:00
R. David Murray a24db67d47 Clarify error report message, and don't recommend running in verbose
mode for more information if we are already running in verbose mode.
2009-10-19 17:53:58 +00:00
R. David Murray 92a27b5206 Eliminate warning message that looks like an error message. When it was
added not finding Lib/test in the path indicated something was wrong,
but when running regtest using "python -m" Lib/test isn't typically in
the path, so this message is now more disturbing than it is helpful.
2009-10-19 16:28:24 +00:00
R. David Murray d9f1944fc3 Only run test_curses when sys.__stdout__ is a tty. This eliminates the
last false positive when running regrtest with -j.
2009-10-19 16:01:28 +00:00
R. David Murray 282396f27a Issue #7151: regrtest would generate a JSON failure if there was output
to stderr during the test run and it happened to get emitted after the
worker thread emitted the result JSON.  Now we capture stdout and stderr
separately, which avoids that problem.  It also means that _all_ stderr
output is after all stdout output when we print the test results, but
that seems acceptable, since output ordering is not guaranteed anyway.
The patch also moves the emit of the test name into the output block
generated after the test completes.  Otherwise test names and test
output/errors were mixed in the terminal display, making it difficult
to determine which test generated the output.
2009-10-18 21:12:37 +00:00
Antoine Pitrou 603acf99d0 Add a comment about unreachable code, and fix a typo 2009-10-18 18:37:11 +00:00
Antoine Pitrou 8a172b14a3 Add a test for same-thread asynchronous exceptions (see #1779233). 2009-10-18 18:22:04 +00:00
Nick Coghlan 53a9dc91d7 Restore sys.path in test_tk 2009-10-18 10:56:21 +00:00
Nick Coghlan f317019c07 Silence a deprecation warning by using the appropriate replacement construct 2009-10-18 10:29:10 +00:00
Nick Coghlan 9039b83c53 Using CleanImport to revert a reload of the os module doesn't work due to function registrations in copy_reg. The perils of reloading modules even for tests... 2009-10-18 05:38:48 +00:00
Mark Dickinson bfd2dc7479 Protect against attempts to replace PyNumber_Add with PyNumber_InPlaceAdd in builtin sum 2009-10-17 21:46:32 +00:00
Nick Coghlan a0e0f9eda4 Don't replace sys.path in test_site 2009-10-17 16:19:51 +00:00
Nick Coghlan 788d7667cb Avoid replacing existing modules and sys.path in import tests 2009-10-17 15:57:42 +00:00
Nick Coghlan 8157e19e8f Also check and restore identity of sys.path, sys.argv and os.environ rather than just their values (this picked up a few more misbehaving tests) 2009-10-17 15:48:16 +00:00
Nick Coghlan fd4903bf05 Move restoration of the os.environ object into the context manager where it belongs 2009-10-17 15:45:52 +00:00
Nick Coghlan 87c03b3108 Revert changes made to environment in test_httpservers 2009-10-17 15:23:08 +00:00
Nick Coghlan 8c1ffeb614 Don't invoke reload(sys) and use StringIO objects instead of real files to capture stdin and stdout when needed (ensures all sys attributes remain unmodified after test_xmlrpc runs) 2009-10-17 15:09:41 +00:00
Nick Coghlan 7df72dcdf9 Restore original sys.path when running TTK tests 2009-10-17 14:40:54 +00:00
Nick Coghlan b6edf193fb Check and revert expected sys.path alterations 2009-10-17 08:21:21 +00:00
Nick Coghlan a3e97ad5ba Formatting tweak so that before and after values are vertically aligned 2009-10-17 07:34:27 +00:00
Nick Coghlan 2ee358eed3 Enhancement to the new environment checking code to print the changed items under -vv. Also includes a small tweak to allow underscores in the names of resources. 2009-10-17 07:30:40 +00:00
Mark Dickinson 59ca92093c test_math ulp computation was wrong on big-endian systems 2009-10-17 07:06:37 +00:00
Nick Coghlan 0447cd6fdc Correctly restore sys.stdout in test_descr 2009-10-17 06:33:05 +00:00
Mark Dickinson 08133af12e Issue #7142: Fix uses of unicode in memoryview objects 2009-10-15 15:53:58 +00:00
Benjamin Peterson 196b0925ca only clear a module's __dict__ if the module is the only one with a reference to it #7140 2009-10-15 15:44:46 +00:00
Benjamin Peterson 96e319e5ac don't need to mess up sys.path 2009-10-15 15:39:15 +00:00
Benjamin Peterson c63457b18e make inspect.isabstract() always return a boolean; add a test for it, too #7069 2009-10-15 03:06:55 +00:00
Benjamin Peterson e52657220c change test to what I intended 2009-10-15 01:56:25 +00:00
Benjamin Peterson 447dc15658 use floor division and add a test that exercises the tabsize codepath 2009-10-15 01:49:37 +00:00
Antoine Pitrou b844ef7950 Silence py3k warning claiming to affect the random module 2009-10-14 18:56:11 +00:00
Antoine Pitrou bb86314d22 Fix failures in test_profilehooks when run with -3 2009-10-14 18:47:13 +00:00
Antoine Pitrou 79d923b8c4 Silence some py3k warnings claiming to affect _pyio 2009-10-14 18:39:46 +00:00
Antoine Pitrou e22997ec7c Silence a py3k warning claiming to affect Lib/calendar.py 2009-10-14 18:09:45 +00:00
Antoine Pitrou 868817eaf5 Fix a test_atexit failure when run with -3 2009-10-14 17:34:31 +00:00
R. David Murray 14dcd43d0b Enhanced Issue 7058 patch, which will not be backported. Refactors the
code, adds checks for stdin/out/err, cwd, and sys.path, and adds a new
section in the summary for tests that modify the environment (thanks to
Ezio Melotti for that suggestion).
2009-10-14 13:58:07 +00:00
Senthil Kumaran 274686631a Fixed Issue6894, urllib2 doesn't respect "no_proxy" environment 2009-10-11 02:00:07 +00:00
Antoine Pitrou 58d2f2689a Issue #7055: test___all__ now greedily detects all modules which have an
__all__ attribute, rather than using a hardcoded and incomplete list.
2009-10-10 20:52:11 +00:00
Mark Dickinson 539bff4234 Update decimal test data to the most recent set from Mike Cowlishaw. 2009-10-08 16:28:39 +00:00
Amaury Forgeot d'Arc d0052d17b1 #1571184: makeunicodedata.py now generates the functions _PyUnicode_ToNumeric,
_PyUnicode_IsLinebreak and _PyUnicode_IsWhitespace.

It now also parses the Unihan.txt for numeric values.
2009-10-06 19:56:32 +00:00
R. David Murray abe3d3ec85 Issue #7058: Added save/restore for argv and os.environ to runtest_inner
in regrtest, with warnings if the called test modifies them.
2009-10-05 17:03:09 +00:00
Mark Dickinson 245d915e3e Issue #7042: Fix test_signal failure on OS X 10.6 64-bit builds
(and also, with luck, on the x86 FreeBSD buildbot), by making sure
that some user time is used in test_itimer_virtual.
2009-10-04 18:38:39 +00:00
Benjamin Peterson 82d31e9b20 test logging 2009-10-04 13:38:38 +00:00
Benjamin Peterson 7adbb5a35d #7050 fix a SystemError when using tuple unpacking and augmented assignment 2009-10-03 20:23:24 +00:00
Georg Brandl f895cf5d33 #7031: Add TestCase.assertIsInstance and negated method. 2009-10-01 20:59:31 +00:00
Senthil Kumaran dc61ec35ec That's self.env.unset(k) and not env.unset(k) I was heading back to the problem. 2009-10-01 01:50:13 +00:00
Senthil Kumaran 5a43e86542 using dict.unset(k) instead of del dict[k]. consistent with release26-maint 2009-10-01 01:19:18 +00:00
Senthil Kumaran 91abd6e68d Fix for issue7026 test_urllib: unsetting missing 'env' variable. 2009-10-01 01:07:03 +00:00
Mark Dickinson 8ca7482cc9 Fix buggy accuracy test 2009-09-30 16:58:01 +00:00
Philip Jenvey 8b9020458a #5329: fix os.popen* regression from 2.5: don't execute commands as a sequence
through the shell. also document the correct subprocess replacement for this
case
patch from Jean-Paul Calderone and Jani Hakala
2009-09-29 19:10:15 +00:00
Mark Dickinson 7e7a3ec901 Issue #7019: Unmarshalling of bad long data could produce unnormalized
PyLongs.  Raise ValueError instead.
2009-09-29 19:01:06 +00:00
Antoine Pitrou 7248178cd9 Issue #6790: Make it possible again to pass an `array.array` to
`httplib.HTTPConnection.send`. Patch by Kirk McDonald.
2009-09-29 17:48:18 +00:00
Philip Jenvey dbf3b258e7 #6990: clear threading.local's key only after its thread state is removed:
fixes local subclasses leaving old state around after a ref cycle GC which
could be recycled by new locals
2009-09-29 04:32:44 +00:00
Mark Dickinson b93fff0a57 Issue #3366: Add gamma function to math module.
(lgamma, erf and erfc to follow).
2009-09-28 18:54:55 +00:00
R. David Murray 97f5ff37ff Prevent test_bad_address failure when a domain in the dns search
path implements a '*' default rule.  Also update comment with
a more complete explanation of the difficulties inherent in
the test.
2009-09-28 16:57:45 +00:00
Skip Montanaro b4fd4d37a1 Patch from Thomas Barr so that csv.Sniffer will set doublequote property.
Closes issue 6606.
2009-09-28 02:12:27 +00:00
Ezio Melotti 9aac2455ab #7000: document "sep" in capwords. Add a few tests 2009-09-26 11:20:53 +00:00
Andrew M. Kuchling b49e53ee16 #6243: fix segfault when keyname() returns a NULL pointer.
Bug noted by Trundle, patched by Trundle and Jerry Chen.
2009-09-25 22:23:54 +00:00
Kristján Valur Jónsson 2fcd03bb77 http://bugs.python.org/issue6971
Adding the SIO_KEEPALIVE_VALS command to socket.ioctl on windows
2009-09-25 15:19:51 +00:00
Brett Cannon 4d94743c28 When range checking was added to time.strftime() a check was placed on tm_isdst
to make sure it fell within [-1, 1] just in case someone implementing
strftime() in libc was stupid enough to assume this. Turns out, though, some
OSs (e.g. zOS) are stupid enough to use values outside of this range for time
structs created by the system itself. So instead of throwing a ValueError,
tm_isdst is now normalized before being passed to strftime().

Fixes issue #6823. Thanks Robert Shapiro for diagnosing the problem and
contributing an initial patch.
2009-09-22 00:29:48 +00:00
Ronald Oussoren 9f20d9d0ee Issue 6877: this patch makes it possible to link the readline extension
to the libedit emulation of the readline API on OSX 10.5 or later.

This also adds a minimal testsuite for readline to check that the
history manipuation functions have the same interface with both
C libraries.
2009-09-20 14:18:15 +00:00
Georg Brandl ab849891ef #6944: the argument to PyArg_ParseTuple should be a tuple, otherwise a SystemError is set. Also clean up another usage of PyArg_ParseTuple. 2009-09-19 07:35:07 +00:00
Benjamin Peterson dc782b55f2 backport keyword argument support for bytearray.decode 2009-09-18 21:46:21 +00:00
Benjamin Peterson 332d721750 add keyword arguments support to str/unicode encode and decode #6300 2009-09-18 21:14:55 +00:00
Mark Dickinson 2985dbb526 Use skipUnless to skip math module tests on non-IEEE 754 platforms. 2009-09-18 21:01:50 +00:00
Georg Brandl ebf3adc4fe #6844 followup: the warning when setting Exception.message was removed, do not test for it. 2009-09-17 11:48:31 +00:00
Georg Brandl e9741f3ed8 Issue #6922: Fix an infinite loop when trying to decode an invalid
UTF-32 stream with a non-raising error handler like "replace" or "ignore".
2009-09-17 11:28:09 +00:00
Georg Brandl 0674d3fb5f #6844: do not emit DeprecationWarnings on access if Exception.message has been set by the user.
This works by always setting it in __dict__, except when it's implicitly set in __init__.
2009-09-16 20:30:09 +00:00
Thomas Wouters c4dcb3801e Fix issue #1590864, multiple threads and fork() can cause deadlocks, by
acquiring the import lock around fork() calls. This prevents other threads
from having that lock while the fork happens, and is the recommended way of
dealing with such issues. There are two other locks we care about, the GIL
and the Thread Local Storage lock. The GIL is obviously held when calling
Python functions like os.fork(), and the TLS lock is explicitly reallocated
instead, while also deleting now-orphaned TLS data.

This only fixes calls to os.fork(), not extension modules or embedding
programs calling C's fork() directly. Solving that requires a new set of API
functions, and possibly a rewrite of the Python/thread_*.c mess. Add a
warning explaining the problem to the documentation in the mean time.

This also changes behaviour a little on AIX. Before, AIX (but only AIX) was
getting the import lock reallocated, seemingly to avoid this very same
problem. This is not the right approach, because the import lock is a
re-entrant one, and reallocating would do the wrong thing when forking while
holding the import lock.

Will backport to 2.6, minus the tiny AIX behaviour change.
2009-09-16 19:55:54 +00:00
Georg Brandl 69dfe8d80e Make the pdb displayhook compatible with the standard displayhook: do not print Nones. Add a test for that. 2009-09-16 16:36:39 +00:00
Georg Brandl 6c39f06ab2 Remove some more boilerplate from the actual tests in test_pdb. 2009-09-16 16:22:12 +00:00
Michael Foord e91ea56b30 Test discovery in unittest will only attempt to import modules that are importable; i.e. their names are valid Python identifiers. If an import fails during discovery this will be recorded as an error and test discovery will continue. Issue 6568. 2009-09-13 19:07:03 +00:00
Michael Foord 5a9719d627 unittest.TestLoader.loadTestsFromName honors the loader suiteClass attribute. Issue 6866. 2009-09-13 17:28:35 +00:00
Michael Foord c3f79373e8 Objects that compare equal automatically pass or fail assertAlmostEqual and assertNotAlmostEqual tests on unittest.TestCase. Issue 6567. 2009-09-13 16:40:02 +00:00
Ezio Melotti 1036a7f7e1 #6026 - fix tests that failed without zlib 2009-09-12 14:43:43 +00:00
Lars Gustäbel 21121e64b4 Issue #6856: Add a filter keyword argument to TarFile.add().
The filter argument must be a function that takes a TarInfo
object argument, changes it and returns it again. If the
function returns None the TarInfo object will be excluded
from the archive.
The exclude argument is deprecated from now on, because it
does something similar but is not as flexible.
2009-09-12 10:28:15 +00:00
Benjamin Peterson 93ed82048f revert unintended changes 2009-09-09 11:42:57 +00:00
Benjamin Peterson 8246968b12 tabbify 2009-09-09 11:40:54 +00:00
Mark Dickinson 5cfa8044ff Issue #6857: Fix Decimal formatting to be consistent with existing float
formatting:  both are now right-aligned by default.
2009-09-08 20:20:19 +00:00
Mark Dickinson 968f1690d3 #Issue 6795: Fix infinite recursion in long(Decimal('nan')); change int(Decimal('nan')) to raise ValueError instead of either returning NaN or raising InvalidContext. 2009-09-07 18:04:58 +00:00
Mark Dickinson 491ea55f28 Issue #6850: Fix bug in Decimal._parse_format_specifier for formats
with no type specifier.
2009-09-07 16:17:41 +00:00
Mark Dickinson c8a7c7c3b9 Issue #6846: bytearray.pop was returning ints in the range [-128, 128)
instead of [0, 256).  Thanks Hagen Fürstenau for the report and fix.
2009-09-06 10:03:31 +00:00
Ronald Oussoren 2596758cb4 Fix build issues on OSX 10.6 (issue 6802) 2009-09-06 10:00:26 +00:00
Georg Brandl ed4ca821f1 #5101: add back tests to test_funcattrs that were lost during unittest conversion, and make some PEP8 cleanups. 2009-09-04 11:19:34 +00:00
Brett Cannon e7e941e7f7 test_platform fails on OS X Snow Leopard because the UNIX command to get the
canonical version, sw_vers, leaves off trailing zeros in the version number
(e.g. 10.6 instead of 10.6.0). Test now compensates by tacking on extra zeros
for the test comparison.

Fixes issue #6806.
2009-09-03 21:25:21 +00:00
Armin Rigo ffd0dc1e8b Sorry, sorry! Ignore my previous two commits. I mixed up the version
of python with which I tried running the crashers.  They don't crash
the current HEAD.
2009-09-03 19:45:27 +00:00
Armin Rigo f866fbb303 Does not terminate: consume all memory without responding to Ctrl-C.
I am not too sure why, but you can surely find out by gdb'ing a bit...
2009-09-03 19:42:03 +00:00
Armin Rigo f416690490 Found the next crasher by thinking about this logic in PyPy. 2009-09-03 19:40:07 +00:00
Benjamin Peterson 6fcf9b50bc remove the check that classmethod's argument is a callable 2009-09-01 22:27:57 +00:00
Amaury Forgeot d'Arc fff896b309 #6750: TextIOWrapped could duplicate output when several threads write to it.
this affect text files opened with io.open(), and the print() function of py3k
2009-08-29 18:14:40 +00:00
Lars Gustäbel f7cda5287d Issue #6054: Do not normalize stored pathnames.
No longer use tarfile.normpath() on pathnames. Store pathnames
unchanged, i.e. do not remove "./", "../" and "//" occurrences.
However, still convert absolute to relative paths.
2009-08-28 19:23:44 +00:00
Mark Dickinson 7a7739d75e Issue #6794: Fix handling of NaNs in Decimal.compare_total and
Decimal.compare_total_mag.
2009-08-28 13:25:02 +00:00
Kristján Valur Jónsson 429677ec38 Issue 6654
Allow the XML-RPC server to use the HTTP request path when dispatching.  Added a MultiPathXMLRPCServer class that uses the feature, plus unit tests.
2009-08-27 23:13:18 +00:00
Kristján Valur Jónsson e2a77980b6 issue 6275
Add an "exc_value" attribute to the _AssertRaisesContext context manager in the unittest package.  This allows further tests on the exception that was raised after the context manager exits.
2009-08-27 22:20:21 +00:00
Tarek Ziadé 764fc235a6 #6693: New functions in site.py to get user/global site packages paths. 2009-08-20 21:23:13 +00:00
Frank Wierzbicki df756775f5 Add test of file.write(array) extracted from Jython. 2009-08-16 20:22:51 +00:00
Gregory P. Smith b98d6b2cbc Issue 6665: Fix fnmatch to properly match filenames with newlines in them. 2009-08-16 18:52:58 +00:00
Benjamin Peterson c0ba828857 better col_offsets for "for" statements with tuple unpacking #6704
Patch from Frank Wierzbicki.
2009-08-15 22:59:21 +00:00
Benjamin Peterson 4c6e8088f5 #6707 fix a crash with dir() on an uninitialized module 2009-08-15 13:16:38 +00:00
Brett Cannon 764465f315 Expat could crash if given the wrong kind of input by never stopping its
tokenizing step.

Thanks to Ivan Krstić for the patch.
2009-08-13 19:27:12 +00:00
Gregory P. Smith c4ad0345cf Fix issue1628205: Socket file objects returned by socket.socket.makefile() now
properly handles EINTR within the read, readline, write & flush methods.
The socket.sendall() method now properly handles interrupted system calls.
2009-08-13 18:54:50 +00:00
Antoine Pitrou 20e1f932fa Issue #6629: Fix a data corruption issue in the new `io` package, which could
occur when writing to a BufferedRandom object (e.g. a file opened in "rb+" or
"wb+" mode) after having buffered a certain amount of data for reading. This
bug was not present in the pure Python implementation.

Yes, this is a serious issue.
2009-08-06 20:18:29 +00:00
Raymond Hettinger 8fdab95260 Issue 6637: defaultdict.copy() failed with an empty factory. 2009-08-04 19:08:05 +00:00
Frank Wierzbicki 6c0f337904 Adding tests derived from the Jython project. These are primarily tests of
'single' statements with partial sentences (so they test things like "try:" in
interactive mode).  Others tests hit areas that previously failed in Jython. A
couple still fail in Jython, mainly due to the difficulty of parsing partial
sentences (but should be fixed by Jython 2.6).
2009-08-02 20:37:48 +00:00
Mark Dickinson 4326ad8f72 Issue #6595: Allow Decimal constructor to accept non-European decimal
digits, as recommended by the specification.  (Backport of r74279 from
py3k.)
2009-08-02 10:59:36 +00:00
Amaury Forgeot d'Arc 3e5b027a64 #6511: ZipFile will now raise BadZipfile when opening an empty or tiny file,
like it does for larger invalid files.
2009-07-28 22:15:30 +00:00
Amaury Forgeot d'Arc e55df1fa2a "Fix" for the refleak report: the ABC classes are now in the _pyio module 2009-07-28 20:47:55 +00:00
Mark Dickinson fe67bd9168 Issue #6561: '\d' regular expression should not match characters of
category [No]; only those of category [Nd].  (Backport of r74237
from py3k.)
2009-07-28 20:35:03 +00:00
Raymond Hettinger c2b9e1a134 Issue 6573: Fix set.union() for cases where self is in the argument chain. 2009-07-27 20:32:04 +00:00
Amaury Forgeot d'Arc 74b3016783 #6553: crash in cPickle.load(), when given a StringIO with incomplete data.
Will backport to 2.6, 3.x already fixed a similar issue with issue4298.
2009-07-23 19:26:02 +00:00
R. David Murray 46ca2f25eb Backport of fix for issue 6542: make sure
test_os.TestInvalidFD.test_closerange does not close any
valid file descriptors.
2009-07-22 17:22:58 +00:00
Georg Brandl ec812caf5d Issue #6540: Fixed crash for bytearray.translate() with invalid parameters. 2009-07-22 11:57:15 +00:00
Benjamin Peterson 4879c907ce the Slice in x[::] has to have step as None to help the interpreter 2009-07-20 20:28:08 +00:00
Kristján Valur Jónsson 6d755900f6 http://bugs.python.org/issue6499
zlib/gzip may not be present for all builds.  Make xmlrpclib gracefully not supporg gzip encoding in this case
2009-07-19 22:14:00 +00:00
Benjamin Peterson d7b0eebcae split unittest.py into a package 2009-07-19 20:18:21 +00:00
Senthil Kumaran 5fee460bfa Fix for issue5102, timeout value propages between redirects, proxy, digest and
auth handlers. Fixed tests to reflect the same.
2009-07-19 02:43:43 +00:00
Mark Dickinson 88a0a2e47f Issue #6431: Fix Fraction comparisons with unknown types, and with
float infinities and nans.  Backport of r74078 from py3k.
2009-07-18 15:18:18 +00:00
Hirokazu Yamamoto e78e5d2e51 Issue #6415: Fixed warnings.warn sagfault on bad formatted string. 2009-07-17 06:20:46 +00:00
Jesse Noller 7530e47948 Issue 6433: multiprocessing.pool.map hangs on empty list 2009-07-16 14:23:04 +00:00
Georg Brandl d77faaf48f #5910: fix kqueue for calls with more than one event. 2009-07-16 07:18:07 +00:00
Ezio Melotti d5a23e322f methods' names pep8ification 2009-07-15 17:07:04 +00:00
Michael Foord 91dcd93beb Move TestRunner initialisation into unittest.TestProgram.runTests. Fixes issue 6418. 2009-07-14 17:58:12 +00:00
Kristján Valur Jónsson 0369ba2a4a http://bugs.python.org/issue6267
Add more tests for the xlmrpc.ServerProxy
2009-07-12 22:42:08 +00:00
Benjamin Peterson 9bd39c119e put downloaded test support files in Lib/test/data instead of the cwd 2009-07-11 22:15:13 +00:00
Amaury Forgeot d'Arc 74b8d333b7 #2622 Import errors in email.message, from a py2app standalone application.
Patch by Mads Kiilerich, Reviewed by Barry Warsaw.
2009-07-11 14:33:51 +00:00
Amaury Forgeot d'Arc 9175742ef0 Add basic tests for the return value of os.popen().close().
According to #6358, python 3.0 has a different implementation that behaves differently.
2009-07-11 09:09:59 +00:00
Kristján Valur Jónsson ef6007c1ae http://bugs.python.org/issue6460
Need to be careful with thread switching when testing the xmlrpc server.  The server thread may not have updated stats when the client thread tests them.
2009-07-11 08:44:43 +00:00
Ezio Melotti 6cbfc12ccd more cleanups and if zlib -> skipUnless(zlib) 2009-07-10 20:25:56 +00:00
Amaury Forgeot d'Arc ce32eb7406 #6416: Fix compilation of the select module on Windows, as well as test_subprocess:
PIPE_BUF is not defined on Windows, and probably has no meaning there.

Anyway the subprocess module uses another way to perform non-blocking reads (with a thread)
2009-07-09 22:37:22 +00:00
R. David Murray b0c828ae4a Try to fix Solaris buildbot rmtree failure in test_getcwd_long_pathnames
cleanup.  If this fix works, it means that Solaris is unique among
our platforms in what happens when shutil.rmtree is called on the
current working directory (ie: it doesn't work on Solaris, but
it does everywhere else).
2009-07-09 18:41:03 +00:00
R. David Murray 6fcf7cae5c Temporarily ignore rmtree errors in test_getcwd_long_pathnames to see
if the test gives useful failure info on Solaris buildbot.
2009-07-09 16:17:30 +00:00
R. David Murray 573399a2f6 Curdir needs to be in the path for the test to work on all buildbots.
(I copied this from another import test, but currently this will fail if
TESTFN ends up in /tmp...see issue 2609).
2009-07-09 15:35:33 +00:00
R. David Murray fbf2cc4d74 Specify umask in execute bit test to get consistent results
and make sure we test resetting all three execute bits.
2009-07-09 13:55:44 +00:00
R. David Murray 00e1f63c6e Make test work with -O. 2009-07-09 02:06:17 +00:00
R. David Murray 8a624a9eb0 Conditionalize test cleanup code to eliminate traceback, which will
hopefully reveal the real problem.
2009-07-09 01:43:41 +00:00
Mark Dickinson 5fd3af24a2 Issue #1523: Remove deprecated overflow masking in struct module, and
make sure that out-of-range values consistently raise struct.error.
2009-07-07 15:08:28 +00:00
Mark Dickinson bb3895cfc6 Expand test coverage for struct.pack with native integer packing;
reorganize the test_struct module to remove duplicated code and tests.
2009-07-07 14:15:45 +00:00
Mark Dickinson ca6b5f36f4 Add skipping to struct test that only applies when overflow masking is in effect 2009-07-07 11:08:23 +00:00
R. David Murray 23a736a4f0 Issue 6070: when creating a compiled file, after copying the mode bits, on
posix zap the execute bit in case it was set on the .py file, since the
compiled files are not directly executable on posix.  Patch by Marco N.
2009-07-07 01:06:13 +00:00
Mark Dickinson 463dc4bf26 Issues #1530559, #1741130: Fix various inconsistencies in struct.pack
integer packing, and reenable some previously broken tests.
2009-07-05 10:01:24 +00:00
Alexandre Vassalotti 5b1abb7bb0 Backport test cases added in r73852. 2009-07-05 06:33:41 +00:00
Alexandre Vassalotti 16a0247393 Fix bad variable name in r73846. 2009-07-05 04:25:46 +00:00
Alexandre Vassalotti 0fe799151f Issue 2370: Add Python 3 warnings for the removal of operator.isCallable and
operator.sequenceIncludes.

Patch contributed by Jeff Balogh (and updated slightly by me).
2009-07-05 04:22:40 +00:00
Ezio Melotti e7a0cc2aa8 if zlib -> skipUnless(zlib) and minor cleanups 2009-07-04 14:58:27 +00:00
Gregory P. Smith dd7ca24eb5 Use select.poll() in subprocess, when available, rather than select() so that
it does not fail when file descriptors are large.  Fixes issue3392.

Patch largely contributed by Frank Chu (fpmc) with some improvements by me.
See http://bugs.python.org/issue3392.

Candidate for backporting to release26-maint as it is a bug fix and changes no
public API.
2009-07-04 01:49:29 +00:00
Benjamin Peterson 50a2252851 condense with assertRaises 2009-07-02 22:56:16 +00:00
Benjamin Peterson d3243d8db8 test that compile() accepts the future flag 2009-07-02 21:38:36 +00:00
Benjamin Peterson 753d16234f when print() gets unicode arguments, sep and end should be unicode by default #4618 2009-07-02 18:16:45 +00:00
Benjamin Peterson 1bf4765369 only order comparisons are removed in py3k #6119 2009-07-02 17:06:17 +00:00
Benjamin Peterson 0c6de43dd9 remove this test; a module level warning is enough 2009-07-02 16:51:56 +00:00
Benjamin Peterson 4d3f18f2ed fix a few cases where automated fail -> assert translation messed up
Thanks Joe Amenta
2009-07-01 00:36:41 +00:00
Benjamin Peterson 6b0032f2c3 use assert* methods in test_unittest 2009-06-30 23:30:12 +00:00
Benjamin Peterson 5c8da86f3a convert usage of fail* to assert* 2009-06-30 22:57:08 +00:00
Jesse Noller 1b90efbdc5 Resolves issues 5155, 5313, 5331 - bad file descriptor error with processes in processes 2009-06-30 17:11:52 +00:00
Antoine Pitrou 79c3bd80ed Backport fix for buglet from py3k 2009-06-29 14:14:56 +00:00
Kristján Valur Jónsson e007860b8b http://bugs.python.org/issue6267
Cumulative patch to http and xmlrpc
2009-06-28 21:04:17 +00:00
Benjamin Peterson 552e7a7e2f return locals and cells in get_locals() not bound globals, though 2009-06-28 19:27:55 +00:00
Amaury Forgeot d'Arc 595f7a5bf9 #2016 Fix a crash in function call when the **kwargs dictionary is mutated
during the function call setup.

This even gives a slight speedup, probably because tuple allocation
is faster than PyMem_NEW.
2009-06-25 22:29:29 +00:00
Amaury Forgeot d'Arc 14fc673d4f Remove the ipaddr module per discussion on python-dev 2009-06-23 21:09:09 +00:00
Raymond Hettinger 62641e9534 Issue 6329: Fix iteration for memoryviews. 2009-06-23 20:59:43 +00:00
R. David Murray ef087da9e7 Fix issue 5230 by having pydoc's safeimport check to see if the import
error was thrown from itself in order to decide if the module can't be
found.  Thanks to Lucas Prado Melo for collaborating on the fix and tests.
2009-06-23 18:02:46 +00:00
Guilherme Polo 7f146ab0ca Issue #5450: Moved tests involving loading tk from Lib/test/test_tcl to
Lib/lib-tk/test/test_tkinter/test_loadtk in order to follow the behaviour of
test_ttkguionly.
2009-06-21 17:22:50 +00:00
Benjamin Peterson dae5db2805 use closures 2009-06-19 22:21:12 +00:00
Benjamin Peterson 5fa09e3eb5 show that this one isn't used 2009-06-19 22:16:28 +00:00
Benjamin Peterson 9c5e4115ab add missing assertion #6313 2009-06-19 22:09:17 +00:00
Benjamin Peterson f1cccaa6b2 remove duplicate test 2009-06-19 22:07:47 +00:00
Georg Brandl c29863e3a6 #6276: Remove usage of nested() in favor of new with statement with multiple managers. 2009-06-18 22:24:26 +00:00
Hirokazu Yamamoto cdcd4bff12 Issue #6215: Fixed to use self.open() instead of open() or io.open(). 2009-06-17 07:05:33 +00:00
Mark Dickinson 5d730177a9 Acknowledge the role of the MPFR library in creating cmath_testcases.txt 2009-06-16 20:31:12 +00:00
Benjamin Peterson 08a0bbc846 don't mask encoding errors when decoding a string #6289 2009-06-16 00:29:31 +00:00
Amaury Forgeot d'Arc f81ff989d6 #6227: Because of a wrong indentation, the test was not testing what it should.
Ensure that the snippet in doctest_aliases actually contains aliases.
2009-06-14 21:20:40 +00:00
Benjamin Peterson a72be3b325 when no module is given in a 'from' relative import, make ImportFrom.module NULL 2009-06-13 20:23:33 +00:00
Benjamin Peterson 52c4bec76b give a better error message when deleting () 2009-06-13 17:08:53 +00:00
Benjamin Peterson d1f5a59edb allow importing from a module named None if it has an 'as' clause 2009-06-13 13:06:21 +00:00
Benjamin Peterson 565e1b6bb7 prevent import statements from assigning to None 2009-06-13 03:46:30 +00:00
Benjamin Peterson 4afbba3d34 keep the slice.step field as NULL if no step expression is given 2009-06-13 01:40:00 +00:00
Alexandre Vassalotti cb73bdac95 Revert r73401 per Raymond Hettinger's request.
The rational is the change might cause imcompatiblity problems with
PyYAML. In addition, Raymond wants to kept the different versions of
collections synchronized across Python versions.
2009-06-12 23:03:35 +00:00
Alexandre Vassalotti 450ae573bc Make pickling of OrderedDict instances more efficient. 2009-06-12 21:52:14 +00:00
Antoine Pitrou c5ae86b9d3 Re-enable testing of builtin open() in test_bufio in test_largefile 2009-06-12 20:54:21 +00:00
Antoine Pitrou 47a5f48006 Try to restore the old test_file and test_univnewlines as new, different files
(with the right revisions this time, hopefully)
2009-06-12 20:41:52 +00:00
Antoine Pitrou c5d2b4156c Restore the old test_file.py (for the builtin file object) as a new file named test_file2k.py 2009-06-12 20:36:25 +00:00
Antoine Pitrou 1969059327 Issue #6215: backport the 3.1 io lib 2009-06-12 20:14:08 +00:00
Amaury Forgeot d'Arc 5217c0848a Missing import in test_curses, uncovered by some buildbots.
(There are still a few test files that don't use the standard layout)
2009-06-09 23:37:11 +00:00
Eric Smith 9eeeee9d71 Restored a test that was erroneously removed. See issue 6198. 2009-06-09 12:38:08 +00:00
Benjamin Peterson a5a5728cf0 remove error checks already done in set_context() 2009-06-08 23:44:13 +00:00
Benjamin Peterson 64092a56ec backport r73273 2009-06-07 23:12:44 +00:00
Georg Brandl 9be5998760 #6206: fix test__locale. 2009-06-06 05:54:34 +00:00
Michael Foord d53d085ada Fix unittest discovery tests for Windows. Issue 6199 2009-06-05 14:14:34 +00:00
Eric Smith 7c58b09b64 Removed tests so that test_float pass on Windows. See issue 6198. 2009-06-05 12:33:26 +00:00
Hirokazu Yamamoto fbf63a7dfa Fix test__locale on windows (Backport of r72365) 2009-06-05 05:15:58 +00:00
Georg Brandl 4da2fa5517 Add test for #3684. 2009-06-04 18:59:58 +00:00
Georg Brandl 46121e79ce Better name for "Ctor". 2009-06-04 10:10:41 +00:00
Georg Brandl 19e79f79ce Avoid PendingDeprecationWarnings emitted by deprecated unittest methods. 2009-06-03 23:23:45 +00:00
Michael Foord dad7b7b1cb Restore default testRunner argument in unittest.main to None. Issue 6177 2009-06-02 18:08:27 +00:00
Gregory P. Smith 61e7fbf2c1 Fixes issue6169: it was possible for two ipaddr network addresses to compare
as both < and > than eachother.
2009-06-02 05:25:34 +00:00
Amaury Forgeot d'Arc b02ceda3a5 #4547: When debugging a very large function, it was not always
possible to update the lineno attribute of the current frame.
2009-06-01 20:53:18 +00:00
R. David Murray 8fcaebbef4 Issue 3848: document the fact that epoll register raises an IOError if
an fd is registered twice, and add some additional epoll tests.  Patch
by Christian Heimes.
2009-05-31 19:15:57 +00:00
Benjamin Peterson 382ccdfd5b remove function import 2009-05-31 14:43:00 +00:00
Antoine Pitrou 4698d9928e Issue #6152: New option '-j'/'--multiprocess' for regrtest allows running
regression tests in parallel, shortening the total runtime.
2009-05-31 14:20:14 +00:00
Antoine Pitrou 4528bcde77 The test for #5330 wasn't correct. 2009-05-30 21:39:25 +00:00
Antoine Pitrou 46dbe27f7e Issue #5330: C functions called with keyword arguments were not reported by
the various profiling modules (profile, cProfile). Patch by Hagen Fürstenau.
2009-05-30 21:27:00 +00:00
Benjamin Peterson 465089271f add with statements 2009-05-29 21:48:19 +00:00
Michael Foord b4a81c838a Add test discovery to unittest. Issue 6001. 2009-05-29 20:33:46 +00:00
R. David Murray 6b98544b32 Refactor test parameterization to resolve update timing problem. 2009-05-29 17:31:05 +00:00
Raymond Hettinger 578a228ee2 Issue 5982: Classmethod and staticmethod expose wrapped function with __func__. 2009-05-29 04:58:52 +00:00
Raymond Hettinger 822b87f276 Deprecate contextlib.nested(). The with-statement now provides this functionality directly. 2009-05-29 01:46:48 +00:00
R. David Murray 8de212bd4f Backport smtplib auth tests from r72990. 2009-05-28 18:49:23 +00:00
Philip Jenvey 6a111027f2 explicitly close files 2009-05-28 05:58:44 +00:00
R. David Murray d67ea7d4c6 fix issue #6121 by stripping spaces from the argument in the 'help'
function.
2009-05-27 20:07:21 +00:00
Benjamin Peterson 39d43b4660 correctly handle descrs with __missing__ 2009-05-27 02:43:46 +00:00
Raymond Hettinger a68cad13ae Fix field name conflicts for named tuples. 2009-05-27 02:24:45 +00:00
Collin Winter 57bef68bc0 Issue 5794: fix cPickle's unpickling of recursive tuples. 2009-05-26 04:12:39 +00:00
Georg Brandl 944f684ce6 Allow multiple context managers in one with statement, as proposed
in http://codereview.appspot.com/53094 and accepted by Guido.

The construct is transformed into multiple With AST nodes so that
there should be no problems with the semantics.
2009-05-25 21:02:56 +00:00
Benjamin Peterson 1880d8b823 add a SETUP_WITH opcode
It speeds up the with statement and correctly looks up the special
methods involved.
2009-05-25 13:13:44 +00:00
Benjamin Peterson 87e5006d8c handle errors from _PyObject_LookupSpecial when __get__ fails 2009-05-25 02:40:21 +00:00
Benjamin Peterson 176a56c69b make class skipping decorators the same as skipping every test of the class
This removes ClassTestSuite and a good bit of hacks.
2009-05-25 00:48:58 +00:00
Martin v. Löwis 0b09c42ffe Issue #6050: Don't fail extracting a directory from a zipfile if
the directory already exists.
2009-05-24 19:30:52 +00:00
Antoine Pitrou d49e375eed Issue #1309352: fcntl now converts its third arguments to a C `long` rather
than an int, which makes some operations possible under 64-bit Linux (e.g.
DN_MULTISHOT with F_NOTIFY).
2009-05-24 15:40:09 +00:00
Senthil Kumaran e266f25cf1 Fixed Issue1424152, urllib2 fails with HTTPS over Proxy. 2009-05-24 09:14:50 +00:00
R. David Murray 3724d6c392 Add smtplib test from issue 5259. 2009-05-23 21:48:06 +00:00
Antoine Pitrou f3bd687b2d Issue #3877: skip a test_fileio subtest on all BSDs, not only FreeBSD 2009-05-23 16:32:32 +00:00
Eric Smith 4b94b192ff Issue 6089: str.format raises SystemError. 2009-05-23 13:56:13 +00:00
R. David Murray 8254d39840 Fix spelling left over from testing. 2009-05-23 02:19:36 +00:00
R. David Murray 812e1c80c4 Don't be so wordy in requires('network') in case other tests
are added later, and skip the existing test if SSL is not available.
2009-05-23 02:16:58 +00:00
R. David Murray ad3058e0b8 Fix Issue #4066: smtplib.SMTP_SSL._get_socket now correctly returns
the socket.  Patch by Farhan Ahmad, test by Marcin Bachry.
2009-05-23 00:48:58 +00:00
Philip Jenvey 739aa36818 don't use subprocess.call with PIPEs as the child can fill the pipe buf and
deadlock. add a warning to subprocess docs about this, similar to Popen.wait's.
refs http://bugs.jython.org/issue1351
2009-05-22 05:35:32 +00:00
Michael Foord a50af06931 Rename TestCase._result to _resultForDoCleanups to avoid potential clashes in TestCase subclasses. Issue 6072. 2009-05-21 22:57:02 +00:00
Mark Dickinson a4e0efa4b1 Issue #5829: don't raise OverflowError for complex('1e500'). Backport of r72803. 2009-05-20 18:43:07 +00:00
Jeffrey Yasskin c8d30fec16 Fix issue #1689458 by teaching frame_setlineno how to jump to the first line of
a code object.
2009-05-20 17:57:57 +00:00
Collin Winter f03c42f0ab Issue 6032: fix refleaks in test_urllib2_localnet. 2009-05-18 21:35:40 +00:00
Jeffrey Yasskin 61328eef1f While I was modifying test_trace, it threw an exception when I accidentally
made it try to set the line number from the trace callback for a 'call' event.
This patch makes the error message a little more helpful in that case, and
makes it a little less likely that a future editor will make the same mistake
in test_trace.
2009-05-18 21:14:54 +00:00
Benjamin Peterson a27dbc68f0 completely ignore old-style stuff for type checking overloading 2009-05-16 22:40:56 +00:00
Benjamin Peterson fb6fb062e8 properly lookup __instancecheck__ and __subclasscheck__ 2009-05-16 21:44:25 +00:00
Benjamin Peterson 757b3c90e6 use skipTest() 2009-05-16 18:44:34 +00:00
Antoine Pitrou 775fd66d7b Issue #2116: Weak references and weak dictionaries now support copy()ing and deepcopy()ing. 2009-05-15 16:54:52 +00:00
Collin Winter 0f489743ef Issue 6024: make regrtest.py promote refleaks to test failures. 2009-05-14 23:26:30 +00:00
Benjamin Peterson 0db3cd6700 a useful decorator for cleaning up threads 2009-05-14 22:40:34 +00:00
Benjamin Peterson 92d102bf6d prevent refleaks from threads 2009-05-14 22:37:49 +00:00
R. David Murray 878555401e Fix test failure on Windows, and add skip check if even unicodedata
turns out not to be an external module on some other platform.
2009-05-14 16:12:57 +00:00
R. David Murray 996ba02602 Issue #4050: inspect.findsource/getsource now raise an IOError if the 'source'
file is a binary.  Patch by Brodie Rao, test by Daniel Diniz.
2009-05-13 17:14:11 +00:00
Michael Foord 5d31e057c5 Adds a verbosity keyword argument to unittest.main plus a minor fix allowing you to specify test modules / classes
from the command line.

Closes issue 5995.

Michael Foord
2009-05-11 17:59:43 +00:00
Mark Dickinson b1d45856c2 Issue #5981: Fix some float.fromhex bugs related to inf and nan handling. 2009-05-11 15:33:08 +00:00
Benjamin Peterson 784d455066 *sigh* deal with instances correctly 2009-05-09 17:23:03 +00:00
Benjamin Peterson af1692a266 convert some more special methods to use _PyObject_LookupSpecial 2009-05-09 16:36:39 +00:00
Benjamin Peterson 809e22543f lookup __reversed__ correctly as a special method 2009-05-09 02:07:04 +00:00
Gregory P. Smith 5edb1a1b0a Fix an off by one error on negative indexs to __getitem__
http://code.google.com/p/ipaddr-py/issues/detail?id=15
2009-05-08 23:16:47 +00:00
Jeffrey Yasskin 1aa4700234 PyCode_NewEmpty:
Most uses of PyCode_New found by http://www.google.com/codesearch?q=PyCode_New
are trying to build an empty code object, usually to put it in a dummy frame
object. This patch adds a PyCode_NewEmpty wrapper which lets the user specify
just the filename, function name, and first line number, instead of also
requiring lots of code internals.
2009-05-08 21:51:06 +00:00
Benjamin Peterson db7ebcf469 fix this test 2009-05-08 17:59:29 +00:00
Benjamin Peterson 399e4c4f8f add _PyObject_LookupSpecial to handle fetching special method lookup 2009-05-08 03:06:00 +00:00
R. David Murray f7e7babb55 Pre-opened test file needs to be opened in binary mode. 2009-05-07 18:09:58 +00:00
R. David Murray 8fd522fb5f Issue5955: aifc's close method did not close the file it wrapped,
now it does.  This also means getfp method now returns the real fp.
2009-05-07 16:27:02 +00:00
Walter Dörwald a7fb408a02 Issue 3739: The unicode-internal encoder now reports the number of *characters*
consumed like any other encoder (instead of the number of bytes).
2009-05-06 14:28:24 +00:00
Eric Smith a985a3aee4 Issue #5920: Changed format.__float__ and complex.__float__ to use a 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. 2009-05-05 18:26:08 +00:00
Georg Brandl 4d4313d59d #5142: add module skipping feature to pdb. 2009-05-05 08:54:11 +00:00
Georg Brandl 7c26d76d9c #1309567: fix linecache behavior of stripping subdirectories from paths when looking for relative filename matches. Also add a linecache test suite. 2009-05-05 08:28:49 +00:00
R. David Murray 7ba8e1cbfd Fix issue 5890: (property subclass shadows __doc__ string) by inserting
the __doc__ into the subclass instance __dict__.  The fix refactors
property_copy to call property_init in such a way that the __doc__
logic is re-executed correctly when getter_doc is 1, thus simplifying
property_copy.
2009-05-04 22:16:24 +00:00
Antoine Pitrou 653dece278 Issue #4426: The UTF-7 decoder was too strict and didn't accept some legal sequences.
Patch by Nick Barnes and Victor Stinner.
2009-05-04 18:32:32 +00:00
Gregory P. Smith d02eedacab Issue #4751: For hashlib algorithms provided by OpenSSL, the Python
GIL is now released during computation on data lengths >= 2048 bytes.
2009-05-04 00:16:49 +00:00
Michael Foord 07ef487a96 2009-05-02 22:43:34 +00:00
Antoine Pitrou 7430989cda Isue #5084: unpickling now interns the attribute names of pickled objects,
saving memory and avoiding growth in size of subsequent pickles. Proposal
and original patch by Jake McGuire.
2009-05-02 21:13:23 +00:00
Michael Foord e2fb98f467 Add addCleanup and doCleanups to unittest.TestCase.
Closes issue 5679.

Michael Foord
2009-05-02 20:15:05 +00:00
Andrew M. Kuchling 420d4eb1f3 #1607951: Make mailbox.Maildir re-read the directories less frequently.
This is done by recording the current time -1sec, and not re-reading unless
the directory mod. times are >= the recorded time.
2009-05-02 19:17:28 +00:00
Gregory P. Smith 6e7bdde2c8 Convert test method names to PEP8 style. 2009-05-02 18:58:21 +00:00
Benjamin Peterson 6282169142 remove py3k compat code 2009-05-02 17:33:01 +00:00
Benjamin Peterson d7e8e3444f don't let sys.argv be used in the tests 2009-05-02 16:24:37 +00:00
Michael Foord 829f6b8052 Adds an exit parameter to unittest.main(). If False main no longer
calls sys.exit.

Closes issue 3379.

Michael Foord
2009-05-02 11:43:06 +00:00
Antoine Pitrou 1fc0231a22 Issue #3002: `shutil.copyfile()` and `shutil.copytree()` now raise an
error when a named pipe is encountered, rather than blocking infinitely.
2009-05-01 20:55:35 +00:00
Gregory P. Smith 1d499265e0 Adds the ipaddr module to the standard library. Issue #3959.
Based off of subversion r69 from http://code.google.com/p/ipaddr-py/

This code is 2to3 safe, I'll merge it into py3k later this afternoon.
2009-05-01 19:59:52 +00:00
Walter Dörwald 6733bed57e Make test.test_support.EnvironmentVarGuard behave like a dictionary.
All changes are mirrored to the underlying os.environ dict, but rolled back
on exit from the with block.
2009-05-01 17:35:37 +00:00
Eric Smith 9139cc6a3b Issue #1588: Add complex.__format__. 2009-04-30 00:58:58 +00:00
Benjamin Peterson 7c7250da45 make sure to close file 2009-04-30 00:06:33 +00:00
Benjamin Peterson a9b4d4777a make sure mode is removable while cleaning up test droppings 2009-04-29 22:44:15 +00:00
Benjamin Peterson 9c6fc5187f fix test_shutil on ZFS #5676 2009-04-29 22:43:35 +00:00
Mark Dickinson 61a0d05291 Backport some of the float formatting tests from py3k. 2009-04-29 21:57:15 +00:00
Mark Dickinson 92fcc9c991 Issue #5864: format(1234.5, '.4') gives misleading result
(Backport of r72109 from py3k.)
2009-04-29 20:41:00 +00:00
R. David Murray 0f457e5825 More aifc tests. 2009-04-29 20:15:18 +00:00
R. David Murray 971b1b100b Now that we've got a test_aifc, add a few tests. 2009-04-29 13:51:44 +00:00
R. David Murray 25b4add5b0 Fix issue 2245. aifc now skips any chunk type it doesn't actually
process instead of throwing errors for anything not in an explicit
skip list.  This is per this spec: http://www.cnpbagwell.com/aiff-c.txt.
Spec reference and test sound file provided by Santiago Peresón, fix
based on patch by Hiroaki Kawai.
2009-04-29 13:17:37 +00:00
Walter Dörwald 4b965f6ab1 Use test.test_support.EnvironmentVarGuard where tests change environment vars. 2009-04-26 20:51:44 +00:00
Walter Dörwald 4c69da2879 Fix typo. 2009-04-26 19:11:43 +00:00
Martin v. Löwis 99f277933e Issue #4971: Fix titlecase for characters that are their own
titlecase, but not their own uppercase.
2009-04-26 00:53:18 +00:00
Eric Smith 068f06568b Issue #5835, deprecate PyOS_ascii_formatd.
If anyone wants to clean up the documentation, feel free. It's my first documentation foray, and it's not that great.

Will port to py3k with a different strategy.
2009-04-25 21:40:15 +00:00
Walter Dörwald 5d98ec76bb Issue #5828 (Invalid behavior of unicode.lower): Fixed bogus logic in
makeunicodedata.py and regenerated the Unicode database (This fixes
u'\u1d79'.lower() == '\x00').
2009-04-25 14:03:16 +00:00
Walter Dörwald a145317be9 Issue #5837: Certain sequences of calls to set() and unset() for
support.EnvironmentVarGuard objects restored the environment variables
incorrectly on __exit__.

Fix this by recording the initial value of each environment variable on the
first access in set() or unset().
2009-04-25 12:15:07 +00:00
Mark Dickinson 0a6501bf56 Fix typo in complex parsing code; expand tests. 2009-04-25 09:47:00 +00:00
Benjamin Peterson 5083dc552b fix a segfault when setting __class__ in __del__ #5283 2009-04-25 00:41:22 +00:00
Mark Dickinson 0badeef93e Remove unnecessary double negative 2009-04-24 16:37:22 +00:00
Mark Dickinson 6ab635a4f4 Issue #5593: Use more robust test for double-rounding in test_fsum.
While we're at it, use new unittest.skipUnless decorator to
implement skipping for that test.
2009-04-24 16:34:14 +00:00
Mark Dickinson 4af8e745c4 Issue #5812: The two-argument form of the Fraction constructor
now accepts arbitrary Rational instances.
2009-04-24 13:56:07 +00:00
Mark Dickinson 95bc980d9e Issue #5816:
- 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')
2009-04-24 12:46:53 +00:00
Mark Dickinson 8100bd8431 Issue #5812: make Fraction('1e-6') valid. Backport of r71806. 2009-04-22 18:15:25 +00:00
Eric Smith ebafbb705c Fixed issue 5782: formatting with commas didn't work if no specifier type code was given. 2009-04-22 16:20:47 +00:00
Nick Coghlan 5533ff6a2e Issue 5354: Change API for import_fresh_module() to better support test_warnings use case (also fixes some bugs in the original implementation) 2009-04-22 15:26:04 +00:00
Eric Smith aca19e6a74 Backport of some of the work in r71665 to trunk. This reworks much of
int, long, and float __format__(), and it keeps their implementation
in sync with py3k.

Also added PyOS_double_to_string. This is the "fallback" version
that's also available in trunk, and should be kept in sync with that
code. I'll add an issue to document PyOS_double_to_string in the C
API.

There are many internal cleanups. Externally visible changes include:

- Implement PEP 378, Format Specifier for Thousands Separator, for
  floats, ints, and longs.

- Issue #5515: 'n' formatting for ints, longs, and floats handles
  leading zero formatting poorly.

- Issue #5772: For float.__format__, don't add a trailing ".0" if
  we're using no type code and we have an exponent.
2009-04-22 13:29:05 +00:00
R. David Murray 95fb46c977 Restore skips of posix and pty tests on Windows by calling the
test_support.import_module on the appropriate modules
before any other imports.
2009-04-21 13:06:04 +00:00
Senthil Kumaran 7c2867fcb1 Fix for the Issue918368 - urllib doesn't correct server returned urls 2009-04-21 03:24:19 +00:00
Mark Dickinson a7e734fcee Nit: integer division should use //, not / 2009-04-20 21:41:04 +00:00
Mark Dickinson 6736cf8d20 Issue #3166: Make long -> float (and int -> float) conversions
correctly rounded, using round-half-to-even.  This ensures that the
value of float(n) doesn't depend on whether we're using 15-bit digits
or 30-bit digits for Python longs.
2009-04-20 21:13:33 +00:00
Benjamin Peterson accb3d0014 move test to a more appropiate one 2009-04-18 21:03:10 +00:00
Benjamin Peterson d4d400cb8a try to initalize all builtin types with PyType_Ready to avoid problems like #5787 2009-04-18 20:12:47 +00:00
Mark Dickinson 1bdf7e9cab Issue #1869: Fix a couple of minor round() issues. 2009-04-18 14:59:42 +00:00
Vinay Sajip 74f045088d Issue #5768: Change to Unicode output logic and test case for same. 2009-04-16 19:07:37 +00:00
Benjamin Peterson 99d36f1563 call __float__ on str subclasses #5759
tests by R. David Murray
2009-04-15 21:26:36 +00:00
R. David Murray dcad046d39 Adjust test_asyncore to account for intentional asyncore behavior change
introduced by r70934 that was causing a test failure when run under -O.
2009-04-13 01:06:46 +00:00
Benjamin Peterson 457fefc3f8 remove useless import 2009-04-12 20:24:56 +00:00
Georg Brandl 21cf5ee6fd #5741: dont disallow double percent signs in SafeConfigParser.set() keys. 2009-04-12 17:24:11 +00:00
R. David Murray 5331d4b4de Make test_asyncore tests match code changes introduced by the
fix to Issue1161031, refactoring the test to simplify it in
the process.
2009-04-11 17:52:56 +00:00
Nick Coghlan cd2e7042ae Issue 5354: Provide a standardised testing mechanism for doing fresh imports of modules, including the ability to block extension modules in order to test the pure Python fallbacks 2009-04-11 13:31:31 +00:00
R. David Murray 0374a82f75 Issue #2170: refactored xml.dom.minidom.normalize, increasing both
its clarity and its speed.
2009-04-09 21:54:50 +00:00
Collin Winter f8089c7789 Issue 5665: add more pickling tests.
- Add tests for the module-level load() and dump() functions.
- Add tests for cPickle's internal data structures, stressing workloads
with many gets/puts.
- Add tests for the Pickler and Unpickler classes, in particular the
memo attribute.
- test_xpickle is extended to test backwards compatibility with Python
2.4, 2.5 and 2.6 by round-tripping pickled objects through a worker
process. This is guarded with a regrtest -u xpickle resource.
2009-04-09 16:46:46 +00:00
Jack Diederich 7f9bb9142e - Make timing assertions very generous (a la test_timeout.py)
- Break the gc cycle in negotiation tests
- test the different guarantees of read_lazy and read_very_lazy
2009-04-07 23:56:57 +00:00
Jack Diederich 3b2312ee5c eliminate more race conditions in telnetlib tests 2009-04-07 20:22:59 +00:00
Vinay Sajip 14bf0a0a37 Issue #5695: Minor tweak to improve the code as suggested by Brett Cannon and as implemented in the Py3K branch. 2009-04-07 17:18:24 +00:00
Benjamin Peterson dda7b1990b revert unrelated change to test_telnetlib 2009-04-07 16:03:04 +00:00
Benjamin Peterson a1b821cf60 fix since difference formating of SyntaxErrors 2009-04-07 15:52:05 +00:00
Benjamin Peterson 52b9620c19 fix syntax tests after formatting change 2009-04-07 15:15:04 +00:00
Gregory P. Smith 923ba361d8 - Issue #2254: Fix CGIHTTPServer information disclosure. Relative paths are
now collapsed within the url properly before looking in cgi_directories.
2009-04-06 06:33:26 +00:00
Jack Diederich 183028ed79 test the telnetlib.Telnet interface more thoroughly 2009-04-06 02:08:44 +00:00
Gregory P. Smith 6d30793cf2 Fixes issue5705: os.setuid() and friends did not accept the same range of
values that pwd.getpwnam() returns.
2009-04-05 23:43:58 +00:00
Michael Foord f2dfef1637 Adding assertIs and assertIsNot methods to unittest.TestCase
Issue #2578
2009-04-05 19:19:28 +00:00
Georg Brandl 3f0ef20269 #5471: fix expanduser() for $HOME set to "/". 2009-04-05 14:48:49 +00:00
Georg Brandl dc4a77159b #1326077: fix traceback formatting of SyntaxErrors. This fixes two differences with formatting coming from Python: a) the reproduction of location details in the error message if no line text is given, b) the prefixing of the last line by one space. 2009-04-05 14:24:52 +00:00
Vinay Sajip 1e566cec6f Issue #5695: Moved logging.captureWarnings() call inside with statement in WarningsTest.test_warnings. 2009-04-05 11:06:24 +00:00
Hirokazu Yamamoto 772033f08c No behavior change. 2009-04-04 17:20:05 +00:00
Raymond Hettinger 756ab67a98 Have namedtuple's field renamer assign names that
are consistent with the corresponding tuple index.
2009-04-02 22:25:40 +00:00
Antoine Pitrou 789be0c0a0 Issue #2396: backport the memoryview object. 2009-04-02 21:18:34 +00:00
Mark Dickinson 48e3fd240f sys.long_info attributes should be ints, not longs 2009-04-02 18:39:37 +00:00
R. David Murray 52720c5455 Add missing iteritems() call to the for loop in mailbox.MH.get_message().
Fixes issue2625.
2009-04-02 14:05:35 +00:00
Michael Foord e2942d073d Store the functions in the _type_equality_funcs as wrapped objects that are deep copyable.
This allows for the deep copying of TestCase instances.

Issue 5660
2009-04-02 05:51:54 +00:00
Jesse Noller 7152f6d915 Add custom initializer argument to multiprocess.Manager*, courtesy of lekma 2009-04-02 05:17:26 +00:00
Michael Foord 345b2fe21e Better exception messages for unittest assert methods.
- unittest.assertNotEqual() now uses the inequality operator (!=) instead
  of the equality operator.

- Default assertTrue and assertFalse messages are now useful.

- TestCase has a longMessage attribute. This defaults to False, but if set to True
  useful error messages are shown in addition to explicit messages passed to assert methods.

Issue #5663
2009-04-02 03:20:38 +00:00
Senthil Kumaran c730a6a123 Fixing the issue4860. Escaping embedded '"' character in js_output() method of Morsel. 2009-04-02 03:00:34 +00:00
Benjamin Peterson 3633c4f7d2 handle SEEK_ constants in test_io 2009-04-02 01:03:17 +00:00
R. David Murray 3864459196 Add tests checking the CSV module's ability to handle
embedded newlines in quoted field values.
2009-04-01 21:26:18 +00:00
Senthil Kumaran 20d114cad2 Fix for issue5040. Adding test for Content-Length 2009-04-01 20:26:33 +00:00
Jack Diederich 2ecd3c36b5 bounds check arguments to mmap.move(). All of them. Really.
fixes crasher on OS X 10.5
2009-04-01 20:26:13 +00:00
Brett Cannon ce3d221447 test_warnings ironically had a single test that was not protecting the warnings
filter and was resetting it.
2009-04-01 20:25:48 +00:00
Brett Cannon 2da4d628a5 test_logging was blindly clearing the warnings filter. This caused
PendingDeprecationWarnings to be spewed all over by unittest.failIf*(). Fix
moves over to using warnings.catch_warning to protect the warnings filter.
2009-04-01 19:57:10 +00:00
Raymond Hettinger 66c4a6b51c Issue #5647: MutableSet.__iand__() no longer mutates self during iteration. 2009-04-01 18:50:56 +00:00
Brett Cannon 15ba4dae5a _warnings was importing itself to get an attribute. That's bad if warnings gets
called in a thread that was spawned by an import itself.

Last part to close #1665206.
2009-04-01 18:03:59 +00:00
Georg Brandl 61fce3877c Fix test_xmlrpc and make the CGI handler work with no CONTENT_LENGTH. 2009-04-01 15:23:43 +00:00
Jesse Noller 02cb0eb231 Fix multiprocessing.event to match the new threading.Event API 2009-04-01 03:45:50 +00:00
R. David Murray a83da3507f Fix issue 2522. locale.format now checks that it is passed
exactly one pattern, which avoids mysterious errors where it
had seemed to fail to do localization.
2009-04-01 03:21:43 +00:00
Josiah Carlson bb94d43dcd Fix for failing asyncore tests. 2009-04-01 01:28:11 +00:00
Georg Brandl d8fb6ac9da Issue #5635: Fix running test_sys with tracing enabled. 2009-04-01 00:04:33 +00:00
Jack Diederich d60c29ed8b #5228: add pickle support to functools.partial 2009-03-31 23:46:48 +00:00
R. David Murray 840ac926c5 Fix Windows test skip error revealed by buildbot. Also a comment spelling
correction in a previously fixed test.
2009-03-31 23:45:39 +00:00
Georg Brandl 0c7b2c9c19 #1651995: fix _convert_ref for non-ASCII characters. 2009-03-31 22:11:53 +00:00
Benjamin Peterson d906ea62c8 fix Thread.ident when it is the main thread or a dummy thread #5632 2009-03-31 21:34:42 +00:00
Georg Brandl ef660e8e50 #1674032: return value of flag from Event.wait(). OKed by Guido. 2009-03-31 20:41:08 +00:00
Hirokazu Yamamoto 1d7d5325be Issue #5387: Fixed mmap.move crash by integer overflow. (take2) 2009-03-31 20:14:04 +00:00
R. David Murray 612f1d5f48 Remove the regrtest check that turns any ImportError into a skipped test.
Hopefully all modules whose imports legitimately result in a skipped
test have been properly wrapped by the previous commits.
2009-03-31 19:49:15 +00:00
R. David Murray bdeacba51b Improve test_support.import_module docstring, remove
deprecated flag from get_attribute since it isn't likely
to do anything useful.
2009-03-31 19:33:15 +00:00
R. David Murray 73fba6915a Delete out-of-date and little-known README from the test
directory by consensus of devs at pycon sprint.
2009-03-31 19:31:17 +00:00
Gregory P. Smith 7558d57ad2 Rename the actual method definitions to the official assertFoo names.
Adds unittests to make sure the old fail* names continue to work now
and adds a comment that they are pending deprecation.

Also adds a test to confirm that the plural Equals method variants
continue to exist even though we're unlikely to deprecate those.

http://bugs.python.org/issue2578
2009-03-31 19:03:28 +00:00
R. David Murray 597ebab744 A few more test skips via import_module, and change import_module to
return the error message produced by importlib, so that if an import
in the package whose import is being wrapped is what failed the skip
message will contain the name of that module instead of the name of the
wrapped module.  Also fixed formatting of some previous comments.
2009-03-31 18:32:17 +00:00
Gregory P. Smith 2839985c7e The unittest.TestCase.assertEqual() now displays the differences in lists,
tuples, dicts and sets on failure.

Many new handy type and comparison specific assert* methods have been added
that fail with error messages actually useful for debugging.  Contributed in
by Google and completed with help from mfoord and GvR at PyCon 2009 sprints.

Discussion lives in http://bugs.python.org/issue2578.
2009-03-31 16:54:10 +00:00
Jeremy Hylton 88f1c04215 Global statements from one function leaked into parallel functions.
Re http://bugs.python.org/issue4315

The symbol table used the same name dictionaries to recursively
analyze each of its child blocks, even though the dictionaries are
modified during analysis.  The fix is to create new temporary
dictionaries via the analyze_child_block().  The only information that
needs to propagate back up is the names of the free variables.

Add more comments and break out a helper function.  This code doesn't
get any easier to understand when you only look at it once a year.
2009-03-31 13:48:15 +00:00
Jeremy Hylton 1c157ea984 Add is_declared_global() which distinguishes between implicit and
explicit global variables.
2009-03-31 13:17:03 +00:00
Hirokazu Yamamoto 9d2ee5ded2 Issue #5387: Fixed mmap.move crash by integer overflow. 2009-03-31 13:13:05 +00:00
Jesse Noller 82eb5902ce merge in patch from tim golden to fix contextmanager support for mp.Lock() 2009-03-30 23:29:31 +00:00
R. David Murray d7bf8a5478 Actually suppress warnings in test_at_least_import_untested_modules
inside the catch_warnings context manager.
2009-03-30 23:10:37 +00:00
R. David Murray 3db8a3432b Change more tests to use import_module for the modules that
should cause tests to be skipped.  Also rename import_function
to the more descriptive get_attribute and add a docstring.
2009-03-30 23:05:48 +00:00
Jesse Noller 019ce773cd finalize the queue prior to shutdown 2009-03-30 21:53:29 +00:00
Senthil Kumaran 5e95e763e1 Fix for bugs: Issue4675 and Issue4962. 2009-03-30 21:51:50 +00:00
R. David Murray e7c9e092b3 Remove references to test_socket_ssl which was deleted in trunk
in r64392 and py3k in r59038.
2009-03-30 20:04:06 +00:00
R. David Murray 59beec326a Add import_function method to test.test_support, and modify a number of
tests that expect to be skipped if imports fail or functions don't
exist to use import_function and import_module.  The ultimate goal is
to change regrtest to not skip automatically on ImportError.  Checking
in now to make sure the buldbots don't show any errors on platforms
I can't direct test on.
2009-03-30 19:04:00 +00:00
Jesse Noller 459a648166 Issue 5177: use socket.SO_REUSEADDR on multiprocessing SocketManager sockets 2009-03-30 15:50:42 +00:00