Commit Graph

14433 Commits

Author SHA1 Message Date
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 bf6c410b2e revert unrelated change 2009-05-02 17:35:39 +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
Senthil Kumaran 4af40d2173 Fix for Issue1648102, based on the MSDN spec: If this parameter specifies the
"<local>" macro as the only entry, this function bypasses any host name that
does not contain a period.
2009-05-01 05:59:52 +00:00
Eric Smith 9139cc6a3b Issue #1588: Add complex.__format__. 2009-04-30 00:58:58 +00:00
Benjamin Peterson 2518d3c1c0 prevent ref cycles by removing bound method on close() 2009-04-30 00:23:11 +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
Tarek Ziadé a1b91d944b Fixed #5874 : distutils.tests.test_config_cmd is not locale-sensitive anymore 2009-04-29 08:03:46 +00:00
Raymond Hettinger a016debad0 Update spec version number. 2009-04-27 21:12:27 +00:00
Antoine Pitrou f2651e193c Issue #5853: calling a function of the mimetypes module from several threads
at once could hit the recursion limit if the mimetypes database hadn't been
initialized before.
2009-04-27 20:50:20 +00:00
Vinay Sajip e34d6aa86f Issue #5854: Updated __all__ to include some missing names and remove some names which should not be exported. 2009-04-27 13:44:27 +00:00
Kurt B. Kaiser 94290d390e Right click 'go to file/line' not working if spaces
in path.  Bug 5559.
2009-04-26 23:22:11 +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
Georg Brandl d40fb70268 Update pydoc topics. 2009-04-26 09:57:29 +00:00
Georg Brandl 438192540d Move pydoc_topics module to its own subdirectory, so that no generated code is in Lib/. 2009-04-26 09:56:44 +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
Georg Brandl 208b00d03f #5841: add deprecation py3k warning and notice in the docs for commands module. 2009-04-25 15:11:29 +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
Tarek Ziadé bcddf6777a #5810: Fixed Distutils test_build_scripts 2009-04-25 12:51:59 +00:00
Tarek Ziadé d567c38ef2 Issue #4951: Fixed failure in test_httpservers 2009-04-25 12:38:08 +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
Thomas Heller ec21ccde12 Issue 5041: ctypes unwilling to allow pickling wide character. 2009-04-24 20:00:41 +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
Kurt B. Kaiser f13447f3f7 Produce correct version string to access the .chm
docs on Windows.  Patch 5783 gpolo.  Will port.
2009-04-23 02:36:01 +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
Vinay Sajip cbb5308723 Issue #5170: Fixed regression caused when fixing #5768. 2009-04-22 12:10:47 +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
Tarek Ziadé 2c4e741447 making BuildWinInstTestCase silent in case bdist_wininst is not run under win32 2009-04-20 10:33:47 +00:00
Tarek Ziadé 92d77b7eac #5795 sysconfig._config_vars was shadowed in tearDown 2009-04-20 07:53:55 +00:00
Mark Dickinson 9be2697fb6 Automatic conversion of floats to integers for struct.pack integer codes
is deprecated.  Use an explicit int() instead.
2009-04-19 17:10:47 +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
Benjamin Peterson baba195eb2 fix a few nits in unittest.py #5771 2009-04-18 19:26:19 +00:00
Mark Dickinson 1bdf7e9cab Issue #1869: Fix a couple of minor round() issues. 2009-04-18 14:59:42 +00:00
Tarek Ziadé 783f493173 DistutilsSetupError was not raised when one single warning occured 2009-04-17 14:29:56 +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
Tarek Ziadé eb6e0f583d pep8-fied 2009-04-13 20:14:54 +00:00
Tarek Ziadé 2fdd0d5ab7 improved test coverage for distutils.cmd 2009-04-13 20:03:44 +00:00
Tarek Ziadé 710fbc32ae deactivate test_search_cpp under win32 2009-04-13 12:42:26 +00:00
Georg Brandl 73709e62ff #5741 followup: should also allow %%(blah)s. 2009-04-13 12:36:24 +00:00
Tarek Ziadé 156c31a7be Fixed #5607: Distutils test_get_platform was failing fo Mac OS X fat binaries. 2009-04-13 12:34:01 +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
Georg Brandl aa48157d3d #5719: add short usage example to optparse docstring. 2009-04-12 20:30:53 +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
Tarek Ziadé 3295eed64b removed string usage and added a test for _clean 2009-04-12 17:02:08 +00:00
Tarek Ziadé e643bed198 added a test for finalize_options 2009-04-12 16:45:32 +00:00
Tarek Ziadé f6f4b3084c added a simple test for search_cpp 2009-04-12 16:31:24 +00:00
Tarek Ziadé 7bea344d35 pep8-fied the module before adding tests 2009-04-12 15:03:50 +00:00
Tarek Ziadé aa48798f1e removed the print statements and added a test 2009-04-12 14:53:51 +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
Tarek Ziadé c2936b786a testing a full check case 2009-04-11 15:14:17 +00:00
Tarek Ziadé 942825f7de #5732: added the check command into Distutils 2009-04-11 14:55:07 +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
Chris Withers b524825788 remove unpleasant exec 2009-04-11 11:22:19 +00:00
Georg Brandl e019706862 #5698: Fix casing of !DOCTYPE to conform to W3C specs. 2009-04-10 08:20:23 +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
Tarek Ziadé ad95826c33 Fixed #5731: Distutils bdist_wininst no longer worked on non-Windows platforms 2009-04-09 21:36:44 +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
Raymond Hettinger 1355a3dbf6 Minor factoring. 2009-04-08 08:26:55 +00:00
Raymond Hettinger a5cd6375c0 Add docstrings. 2009-04-08 05:39:38 +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
Benjamin Peterson a27e6e3d58 add create_connection to __all__ #5711 2009-04-06 21:53:33 +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