summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* Give return stmts their own lines.Tim Peters2004-08-091-2/+4
|
* Indent body of _EXAMPLE_RE for readability. _IS_BLANK_OR_COMMENT makesTim Peters2004-08-091-13/+13
| | | | more sense as a callable.
* Changed Parser.get_examples() to return a list of Example objects,Edward Loper2004-08-091-21/+13
| | | | rather than a list of triples.
* - Split DocTestRunner's check_output and output_difference methods offEdward Loper2004-08-091-127/+139
| | | | | | into their own class, OutputChecker. - Added optional OutputChecker arguments to DocTestRunner, DocTestCase, DocTestSuite.
* Rewrote Parser, using regular expressions instead of walking thoughEdward Loper2004-08-092-221/+227
| | | | | | | | | the string one line at a time. The resulting code is (in my opinion, anyway), much easier to read. In the process, I found and fixed a bug in the orginal parser's line numbering in error messages (it was inconsistant between 0-based and 1-based). Also, check for missing blank lines after the prompt on all prompt lines, not just PS1 lines (test added).
* Fixed doctest error (wrong prompts)Edward Loper2004-08-091-3/+3
|
* Add a test for Context.copy().Raymond Hettinger2004-08-081-0/+8
|
* Tell unittest that source files with "badsyntax" in their names shouldTim Peters2004-08-081-1/+5
| | | | | raise SyntaxError. test_compiler passes now on WinXP, at least in a release-build non-O run.
* Renamed locals to better reflect their meanings.Tim Peters2004-08-081-6/+6
|
* In verbose mode, display the name of each file before trying to compileTim Peters2004-08-081-1/+4
| | | | | it. Else when this fails, there's no way to tell which file it was chewing on.
* Bug 1003935: xrange overflowsTim Peters2004-08-081-1/+6
| | | | | | | | | | | | | | | Added XXX comment about why the undocumented PyRange_New() API function is too broken to be worth the considerable pain of repairing. Changed range_new() to stop using PyRange_New(). This fixes a variety of bogus errors. Nothing in the core uses PyRange_New() now. Documented that xrange() is intended to be simple and fast, and that CPython restricts its arguments, and length of its result sequence, to native C longs. Added some tests that failed before the patch, and repaired a test that relied on a bogus OverflowError getting raised.
* Get rid of the ignore_imports argument to DocTestFinder.find().Tim Peters2004-08-083-41/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This got slammed in when find() was fixed to stop grabbing doctests from modules imported *by* the module being tested. Such tests cannot be expected to succeed, since they'll be run with the current module's globals. Dozens of Zope3 doctests were failing because of that. It wasn't clear why ignore_imports got added then. Maybe it's because some existing tests failed when the change was made. Whatever, it's a Bad Idea so it's gone now. The only use of it was exceedingly obscure, in test_doctest's "Duplicate Removal" test. It was "needed" there because, as an artifact of running a doctest inside a doctest, the func_globals of functions compiled in the second-level doctest don't match the module globals, and so the test-finder believed these functions were from a foreign module and skipped them. But that took a long time to figure out, and I actually understand some of this stuff <0.9 wink>. That problem was resolved by moving the source code for the second-level doctest into an actual module (test/doctest_aliases.py). The only remaining difficulty was that the test for the deprecated Tester.rundict() then failed, because the test finder doesn't take module=None at face value, trying to guess which module the user really intended then. Its guess wasn't appropriate for what Tester.rundict needs when module=None is given to *it*, which is "no, there is no module here, and I mean it". So now passing module=False means exactly that. This is hokey, but ignore_imports=False was really a hack to worm around that there was no way to tell the test-finder that module=None *sometimes* means what it says. There was no use case for the combination of passing a real module with ignore_imports=False.
* * Context.copy() now makes a deepcopy.Raymond Hettinger2004-08-081-12/+21
| | | | * Facilitate reloads of local thread.
* Type in docstring.Tim Peters2004-08-081-1/+1
|
* Also deprecated the old Tester class, which is no longer used by anythingTim Peters2004-08-081-2/+13
| | | | except internal tests.
* Deprecate the doctest.is_private() function.Tim Peters2004-08-081-0/+6
|
* Deprecated testmod's useless & confusing isprivate gimmick.Tim Peters2004-08-082-61/+32
| | | | | | | Ripped out the docs for the new DocTestFinder's namefilter argument, and renamed it to _namefilter; this only existed to support isprivate. Removed the new DocTestFinder's objfilter argument. No point adding more cruft to a broken filtering design.
* Whitespace normalization.Tim Peters2004-08-082-6/+3
|
* Purged Berkeley code of references to the long-obsolete whrandom.Tim Peters2004-08-083-5/+4
|
* Trigger DeprecationWarningAndrew M. Kuchling2004-08-071-0/+4
|
* Let's not use string exceptions any more.Armin Rigo2004-08-071-1/+2
|
* Removing tests that fail because of changes in PyString_InternInPlace(),Armin Rigo2004-08-071-16/+0
| | | | | as discussed on IRC. The equivalent tests for the new behavior are in test_builtin.py.
* Add a trivial test for the compiler package, guarded by compiler resource.Jeremy Hylton2004-08-072-1/+39
| | | | | | This test is insanely slow, so it requires a resource. On my machine, it also appears to dump core. I think the problem is a stack overflow, but haven't been able to confirm.
* SF patch 836879.Jeremy Hylton2004-08-071-21/+19
| | | | Don't generate code for asserts in -O mode.
* Subclasses of string can no longer be interned. The semantics ofJeremy Hylton2004-08-071-0/+17
| | | | | | | | | | | interning were not clear here -- a subclass could be mutable, for example -- and had bugs. Explicitly interning a subclass of string via intern() will raise a TypeError. Internal operations that attempt to intern a string subclass will have no effect. Added a few tests to test_builtin that includes the old buggy code and verifies that calls like PyObject_SetAttr() don't fail. Perhaps these tests should have gone in test_string.
* [Bug #866222] Update docstrings.Andrew M. Kuchling2004-08-071-4/+3
|
* [Bug #990792] Mention that repl can be a callableAndrew M. Kuchling2004-08-071-2/+6
|
* Fix urllib2.urlopen() handling of chunked content encoding.Jeremy Hylton2004-08-073-2/+108
| | | | | | | | | | | | | | | | | The change to use the newer httplib interface admitted the possibility that we'd get an HTTP/1.1 chunked response, but the code didn't handle it correctly. The raw socket object can't be pass to addinfourl(), because it would read the undecoded response. Instead, addinfourl() must call HTTPResponse.read(), which will handle the decoding. One extra wrinkle is that the HTTPReponse object can't be passed to addinfourl() either, because it doesn't implement readline() or readlines(). As a quick hack, use socket._fileobject(), which implements those methods on top of a read buffer. (suggested by mwh) Finally, add some tests based on test_urllibnet. Thanks to Andrew Sawyers for originally reporting the chunked problem.
* Add argument to docstringAndrew M. Kuchling2004-08-071-1/+1
|
* Resolution of bug #997368, "strftime() backward compatibility".Barry Warsaw2004-08-074-5/+5
| | | | | | | | | Specifically, time.strftime() no longer accepts a 0 in the yday position of a time tuple, since that can crash some platform strftime() implementations. parsedate_tz(): Change the return value to return 1 in the yday position. Update tests in test_rfc822.py and test_email.py
* SF bug 874842 and patch 997626: httplib bugsJeremy Hylton2004-08-072-11/+64
| | | | | | Hack httplib to work with broken Akamai proxies. Make sure that httplib doesn't add extract Accept-Encoding or Content-Length headers if the client has already set them.
* Make 'bin' argument trigger DeprecationWarningAndrew M. Kuchling2004-08-071-1/+1
|
* Resolution of SF bug #1002475 and patch #1003693; Header lines that end inBarry Warsaw2004-08-072-3/+33
| | | | | | | | | | \r\n only get the \n stripped, not the \r (unless it's the last header which does get the \r stripped). Patch by Tony Meyer. test_whitespace_continuation_last_header(), test_strip_line_feed_and_carriage_return_in_headers(): New tests. _parse_headers(): Be sure to strip \r\n from the right side of header lines.
* This is more-or-less:Michael W. Hudson2004-08-071-3/+4
| | | | | | | [ 1005123 ] test_curses fails on MacOS X 10.3 Be a bit more guarded about what we expect a terminal to be capable of.
* Somehow (no idea how!) I missed half of patch #1005008. Sorry about that.Michael W. Hudson2004-08-071-1/+1
|
* This is patchMichael W. Hudson2004-08-071-17/+4
| | | | | | | [ 1005008 ] curses.wrapper should also forward keyword args Plus my rewrite to use finally as opposed to painfully doing the equivalent by hand.
* Exercise DocTestSuite's search for __test__.Raymond Hettinger2004-08-071-2/+2
|
* Whitespace normalization.Tim Peters2004-08-075-139/+139
|
* Bug 772091: doctest.DocTestSuite does not support __test__Tim Peters2004-08-072-16/+29
| | | | | This got fixed "by magic" as part of the refactoring, but wasn't tested as such. Now it is.
* SF bug #1004669: Type returned from .keys() is not checkedRaymond Hettinger2004-08-071-0/+9
|
* SF bug #1002530: test_decimal fails if repeatedRaymond Hettinger2004-08-061-6/+8
| | | | | * Protect the pre-defined contexts by using a deepcopy() instead of copy(). * Micro-optimization: prefer x&1 over x%2
* Merging from tim-doctest-branch, which is now closed.Tim Peters2004-08-065-182/+919
| | | | | | This primarily adds more powerful ways to work with unittest, including spiffy support for building suites out of doctests in non-Python "text files".
* Changes the remote address used for tests in TimeoutTestCase from google.com toBrett Cannon2004-08-061-1/+1
| | | | | | python.org . This way the delay should be great enough for testConnectTimeout() to pass even when one has a really fast Net connection that allows connections faster than .001 seconds.
* Added new codecs and aliases for ISO_8859-11, ISO_8859-16 andMarc-André Lemburg2004-08-054-1/+285
| | | | | | TIS-620. Closes SF bug #1001895: Adding missing ISO 8859 codecs, especially Thai.
* release dateAnthony Baxter2004-08-051-1/+1
|
* Example.__init__: this cannot use assert, because that fails to triggerTim Peters2004-08-042-5/+8
| | | | | in a -O run, and so test_doctest was failing under -O. Simple cause, simple cure.
* Edward Loper's cool and massive refactoring of doctest.py, merged fromTim Peters2004-08-042-945/+2375
| | | | | | | | the tim-doctest-merge-24a2 tag on the the tim-doctest-branch branch. We did development on the branch in case it wouldn't land in time for 2.4a2, but the branch looked good: Edward's tests passed there, ditto Python's tests, and ditto the Zope3 tests. Together, those hit doctest heavily.
* To ever run this test "you must import TestSkipped" from the rightMichael W. Hudson2004-08-041-6/+9
| | | | | | | place! (can that please be it for silly mistakes in this file? :-) I know I started it, but...). Also, rearrangements to run repeatedly.
* Updated Logger.log() docstring to clarify that lvl parameter should be an ↵Vinay Sajip2004-08-041-1/+1
| | | | integer.
* Close handlers and tidy up loggers by removing closed handlers - to avoid ↵Vinay Sajip2004-08-041-5/+11
| | | | problems when run twice (SF #1002537)