summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* This file is no longer used in version 2.39.Raymond Hettinger2004-08-171-151/+0
| | | | Was supplanted by tointegral.decTest.
* Add two new files and update remaining tests from the latest update of theRaymond Hettinger2004-08-1731-191/+1190
| | | | test suite in version 2.39 of dectest.zip.
* * Dynamically build a list of files to be tested (necessary becauseRaymond Hettinger2004-08-171-81/+14
| | | | | | | version 2.39 of dectest.zip adds some new test files and because some existing test files were getting skipped). * Remove two docstrings which cluttered unittest's output. * Simplify a for-loop with a list comprehension.
* Being bsd-based, darwin/macosx has the same limitation w.r.t. the "echo"Skip Montanaro2004-08-161-1/+1
| | | | service.
* Minor formatting cleanup.Raymond Hettinger2004-08-161-5/+6
|
* * Uncomment the SyntaxError doctest after Tim demonstrated how.Raymond Hettinger2004-08-161-11/+6
| | | | * Remove unnecessary sys.PS2 prompt lines.
* - Bug #891637, patch #1005466: fix inspect.getargs() crash on def foo((bar)).Matthias Klose2004-08-151-0/+8
|
* Correct the order of application for decorators. Meant to be bottom-up and notBrett Cannon2004-08-151-7/+16
| | | | top-down. Now matches the PEP.
* bug #990669: os.path.realpath() will resolve symlinks before normalizing theJohannes Gijsbers2004-08-141-2/+95
| | | | | | | | path, as normalizing the path may alter the meaning of the path if it contains symlinks. Also add tests for infinite symlink loops and parent symlinks that need to be resolved.
* Unwrap too-smart loop: we can't use `src` for both hard and symbolic links.Johannes Gijsbers2004-08-141-8/+16
|
* Raise an exception when src and dst refer to the same file via a hard link or aJohannes Gijsbers2004-08-141-0/+21
| | | | symbolic link (bug #851123 / patch #854853, thanks Gregory Ball).
* Reset old locale after running tests. Not doing so brokeJohannes Gijsbers2004-08-141-19/+23
| | | | test_format/test_unicode in some circumstances (patch #1007539/bug #992078).
* Whitespace normalization.Tim Peters2004-08-132-6/+6
|
* SF patch #1005778, Fix seg fault if list object is modified during list.index()Neal Norwitz2004-08-131-0/+12
| | | | Backport candidate
* include at least one example of an exception passing through pyexpatFred Drake2004-08-131-0/+15
|
* Report refleaks to stderr as the tests run as well as logging themMichael W. Hudson2004-08-121-0/+2
| | | | to a file.
* This is my patchMichael W. Hudson2004-08-121-2/+9
| | | | | | | [ 1004703 ] Make func_name writable plus fixing a couple of nits in the documentation changes spotted by MvL and a Misc/NEWS entry.
* Fix bugMichael W. Hudson2004-08-121-6/+62
| | | | | | | | | | [ 1005248 ] new.code() not cleanly checking its arguments using the result of new.code() can still destroy the sun, but merely calling the function shouldn't any more. I also rewrote the existing tests of new.code() to use vastly less un-bogus arguments, and added tests for the previous insane behaviours.
* - Changed output of DocTestParser.get_program() to make it easier toEdward Loper2004-08-121-8/+8
| | | | | | | | visually distinguish the expected output from the comments (use "##" to mark expected outputs, and "#" to mark comments). - If the string given to DocTestParser.get_program() is indented, then strip its indentation. (In particular, find the min indentation of non-blank lines, and strip that indentation from all lines.)
* - Added __docformat__Edward Loper2004-08-121-4/+6
| | | | | | | - Added comments for some regexps - If the traceback type/message don't match, then still print full traceback in report_failure (not just the first & last lines) - Renamed DocTestRunner.__failure_header -> _failure_header
* - Changed option directives to be example-specific. (i.e., they nowEdward Loper2004-08-121-29/+153
| | | | | | | | | modify option flags for a single example; they do not turn options on or off.) - Added "indent" and "options" attributes for Example - Got rid of add_newlines param to DocTestParser._parse_example (it's no longer needed; Example's constructor now takes care of it). - Added some docstrings
* Whitespace normalization.Tim Peters2004-08-091-1/+1
|
* Edward's latest checkins somehow managed to wipe out my previous latestTim Peters2004-08-091-1/+0
| | | | checkins. Reapplying the latter changes.
* - DocTest is now a simple container class; its constructor is no longerEdward Loper2004-08-091-7/+10
| | | | | | | | | | | responsible for parsing the string. - Renamed Parser to DocTestParser - DocTestParser.get_*() now accept the string & name as command-line arguments; the parser's constructor is now empty. - Added DocTestParser.get_doctest() method - Replaced "doctest_factory" argument to DocTestFinder with a "parser" argument (takes a DocTestParser). - Changed _tag_msg to take an indentation string argument.
* This started as a spelling and whitespace cleanup. The comment forTim Peters2004-08-091-6/+5
| | | | | | | | | the set_trace fiddling didn't make sense to me, and I ended up reworking that part of the code. We really do want to save and restore pdb.set_trace, so that each dynamically nested level of doctest gets sys.stdout fiddled to what's appropriate for *it*. The only "trick" really needed is that these layers of set_trace wrappers each call the original pdb.set_trace (instead of the current pdb.set_trace).
* Added support for pdb.set_trace.Jim Fulton2004-08-091-0/+87
|
* Patch #1003700: Add socketpair function to socket module.Dave Cole2004-08-091-0/+43
|
* Drop the excruciating newline requirements on arguments toTim Peters2004-08-091-17/+27
| | | | | | Example.__init__. The constructor now adds trailing newlines when needed, and no longer distinguishes between multi- and single-line cases for source.
* Rewrote Parser, using regular expressions instead of walking thoughEdward Loper2004-08-091-2/+11
| | | | | | | | | 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-082-16/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Deprecated testmod's useless & confusing isprivate gimmick.Tim Peters2004-08-081-21/+8
| | | | | | | 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-081-3/+0
|
* 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.
* 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.
* Fix urllib2.urlopen() handling of chunked content encoding.Jeremy Hylton2004-08-072-0/+94
| | | | | | | | | | | | | | | | | 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.
* Resolution of bug #997368, "strftime() backward compatibility".Barry Warsaw2004-08-071-1/+1
| | | | | | | | | 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-071-1/+44
| | | | | | 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.
* 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.
* Exercise DocTestSuite's search for __test__.Raymond Hettinger2004-08-071-2/+2
|
* Whitespace normalization.Tim Peters2004-08-071-1/+1
|
* 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
|