Commit Graph

30696 Commits

Author SHA1 Message Date
Edward Loper 12a4baf5a1 Remove unused method _OutputRedirectingPdb.resume 2004-08-27 04:29:23 +00:00
Edward Loper 2de91ba2ab - Removed redundant call to expandtabs in DocTestParesr.
- Improvements to interactive debugging support:
  - Changed the replacement pdb.set_trace to redirect stdout to the
    real stdout *only* during interactive debugging; stdout from code
    continues to go to the fake stdout.
  - When the interactive debugger gets to the end of an example,
    automatically continue.
  - Use a replacement linecache.getlines that will return source lines
    from doctest examples; this makes the source available to the
    debugger for interactive debugging.
- In test_doctest, use a specialized _FakeOutput class instead of a
  temporary file to fake stdin for the interactive interpreter.
2004-08-27 02:07:46 +00:00
Tim Peters 8ce9f16259 PyUnicode_Join(): Two primary aims:
1. u1.join([u2]) is u2
2. Be more careful about C-level int overflow.

Since PySequence_Fast() isn't needed to achieve #1, it's not used -- but
the code could sure be simpler if it were.
2004-08-27 01:49:32 +00:00
Edward Loper 00f8da77e7 - Added DocTestParser.parse(), which parses a docstring into Examples
and intervening text strings.
- Removed DocTestParser.get_program(): use script_from_examples()
  instead.
- Fixed bug in DocTestParser._INDENT_RE
- Fixed bug in DocTestParser._min_indent
- Moved _want_comment() to the utility function section
2004-08-26 18:05:07 +00:00
Walter Dörwald 57d88e5abd Move test_bug1001011() to string_tests.MixinStrUnicodeTest so that
it can be used for str and unicode. Drop the test for
   "".join([s]) is s
because this is an implementation detail (and doesn't work for unicode)
2004-08-26 16:53:04 +00:00
Johannes Gijsbers 592ef6110f Correct incorrect "it's" to "its". 2004-08-26 10:40:12 +00:00
Tim Peters e7edcb8e22 output_difference(): In fancy-diff cases, the way this split expected &
actual output into lines created spurious empty lines at the ends of
each.  Those matched, but the fancy diffs had surprising line counts (1
larger than expected), and tests kept having to slam <BLANKLINE> into the
expected output to account for this.  Using the splitlines() string method
with keepends=True instead accomplishes what was intended directly.
2004-08-26 05:44:27 +00:00
Martin v. Löwis 4085f030bd Add missing executable option to DummyCommand. 2004-08-26 05:44:02 +00:00
Tim Peters 66cb018c96 Whitespace normalization. 2004-08-26 05:23:19 +00:00
Tim Peters 5b799c1f3d _do_a_fancy_diff(): Pay no attention to the ellipses behind the curtain.
While a fancy diff can be confusing in the presence of ellipses, so far
I'm finding (2-0-0) that it's much more a major aid in narrowing down the
possibilities when an ellipsis-slinging test fails.  So we no longer
refuse to do a fancy diff just because of ellipses.

This isn't ideal; it's just better.
2004-08-26 05:21:59 +00:00
Tim Peters f33683fd40 Fine tune a word. 2004-08-26 04:52:46 +00:00
Tim Peters cf53355fcf Thinko repair. 2004-08-26 04:50:38 +00:00
Tim Peters a07bcd46f3 Reorg of exception section. Now that there are fewer details needing
explanation, it's easier to push the remaining insufferably anal details
into a "fine print" section at the bottom.
2004-08-26 04:47:31 +00:00
Raymond Hettinger 770acc2bb4 Remove unnecessary line. 2004-08-26 04:29:47 +00:00
Raymond Hettinger f4fd79ca49 Small wording fixups. 2004-08-26 03:11:56 +00:00
Edward Loper ca9111eef3 Changed OutputChecker.output_difference to expect an Example object,
rather than an expected output string.  This gives the
output_difference method access to more information, such as the
indentation of the example, which might be useful.
2004-08-26 03:00:24 +00:00
Edward Loper a89f88d53f Added REPORT_ONLY_FIRST_FAILURE flag, which supresses output after the
first failing example in each test.
2004-08-26 02:45:51 +00:00
Brett Cannon cc8a4f6563 When building with --disable-toolbox-glue under Darwin, skip building any
Mac-specific modules.  Before all modules were compiled but would fail thanks
to a dependence on the code included when Python was built without the compiler
flag.

Closes bug #991962.
2004-08-26 01:44:07 +00:00
Edward Loper 71f55af826 Renamed UNIFIED_DIFF->REPORT_UDIFF; CONTEXT_DIFF->REPORT_CDIFF; and
NDIFF_DIFF->REPORT_NDIFF.  This establishes the naming convention that
all reporting options should begin with "REPORT_" (since reporting
options are a different class from output comparison options; but they
are both set in optionflags).
2004-08-26 01:41:51 +00:00
Edward Loper 5662929a42 Shortened diff output for unified & context diffs 2004-08-26 01:31:56 +00:00
Edward Loper aacf083388 - Changed the output of report_start() and report_unexpected_exception()
to be more consistent with report_failure()
- If `want` or `got` is empty, then print "Expected nothing\n" or
  "Got nothing\n" rather than "Expected:\n" or "Got:\n"
- Got rid of _tag_msg
2004-08-26 01:19:50 +00:00
Tim Peters 0e448073d6 Restored half of a \versionadded only half of which should have been
deleted.
2004-08-26 01:02:08 +00:00
Dave Cole e8bbfe4e63 Patch #1015012. Improve markup and punctuation in libsocket.tex 2004-08-26 00:51:16 +00:00
Dave Cole 3203efb55f Patch #1014930. Expose current parse location to XMLParser. 2004-08-26 00:37:31 +00:00
Raymond Hettinger 0d58e2be0b Minor improvements to the template code.
* Add comment bars segregating this code from the rest.
* Improve readability of the re pattern with indentation and comments on
  the same line.
* Replace the groupdict() and get() pair with a direct call to group()
  which does the same thing.
2004-08-26 00:21:13 +00:00
Edward Loper a6b68327b2 Added an "exc_msg" attribute to Example (containing the expected
exception message, or None if no exception is expected); and moved
exception parsing from DocTestRunner to DocTestParser.  This is
architecturally cleaner, since it moves all parsing work to
DocTestParser; and it should make it easier for code outside
DocTestRunner (notably debugging code) to properly handle expected
exceptions.
2004-08-26 00:05:43 +00:00
Trent Mick c5625bac68 Re-generate configure with recent configure.in change (for patch #1016224). 2004-08-25 23:59:39 +00:00
Trent Mick af16e8c390 Apply patch #1016224: configure.in change to allow build of _bsddb module on
AIX 5.1.
2004-08-25 23:55:59 +00:00
Edward Loper 19b1958730 Only recognize the expected output as an exception if it *starts* with
a traceback message.  I.e., examples that raise exceptions may no
longer generate pre-exception output.  This restores the behavior of
doctest in python 2.3.  The ability to check pre-exception output is
being removed because it makes the documentation simpler; and because
there are very few use cases for it.
2004-08-25 23:07:03 +00:00
Raymond Hettinger d2afee47b1 Fix docstring typo. 2004-08-25 19:42:12 +00:00
Raymond Hettinger 1792bfbf90 Bypass peepholing of code with lineno tables having intervals >= 255.
Allows the lineno fixup code to remain simple and not have to deal with
multibyte codings.

* Add an assertion to that effect.
* Remove the XXX comment on the subject.
2004-08-25 17:19:38 +00:00
Raymond Hettinger 65d3c0537a Fix typo in comment and add clarification. 2004-08-25 15:15:56 +00:00
Fred Drake e3a1b4888c clean up markup for --executable description 2004-08-25 14:01:32 +00:00
Andrew M. Kuchling 87c98b2e4b Add various items 2004-08-25 13:38:46 +00:00
Martin v. Löwis cae9e673d6 Patch #970015: Replace - by _ in version and release. 2004-08-25 13:04:53 +00:00
Martin v. Löwis cf525241bb Patch #970019: Include version and release in the BuildRoot. 2004-08-25 13:00:34 +00:00
Martin v. Löwis 9f5c0c41ce Patch #736857, #736859: Add -e option to build_scripts. 2004-08-25 11:37:43 +00:00
Martin v. Löwis be83737c7c Patch #798244: More urllib2 examples. 2004-08-25 11:24:42 +00:00
Martin v. Löwis c11d6f13ae Patch #1014992: Never return more than a line from readline.
Will backport to 2.3.
2004-08-25 10:52:58 +00:00
Martin v. Löwis 8d494f3241 Patch #1015021: Stop claiming that coerce can return None.
Will backport to 2.3.
2004-08-25 10:42:41 +00:00
Martin v. Löwis b92b7ed9d6 Back out 1.289, which breaks platforms needing addrinfo.h, and
1.293, 1.298, and 1.300, which have tried to fix this for specific
platforms.
2004-08-25 06:24:58 +00:00
Raymond Hettinger ef0a82b682 Simplify chains of conditional jumps.
(Suggested by Neal Norwitz.)
2004-08-25 03:18:29 +00:00
Barry Warsaw 08b07def43 Ah whoops, we didn't turn string into a package (thanks Neal!) 2004-08-25 03:09:58 +00:00
Barry Warsaw 8bee76106e PEP 292 classes Template and SafeTemplate are added to the string module.
This patch includes test cases and documentation updates, as well as NEWS file
updates.

This patch also updates the sre modules so that they don't import the string
module, breaking direct circular imports.
2004-08-25 02:22:30 +00:00
Tim Peters c885443479 Stop producing or using OverflowWarning. PEP 237 thought this would
happen in 2.3, but nobody noticed it still was getting generated (the
warning was disabled by default).  OverflowWarning and
PyExc_OverflowWarning should be removed for 2.5, and left notes all over
saying so.
2004-08-25 02:14:08 +00:00
Neal Norwitz 1fa040ba73 SF #1015517, get readline to compile with older compilers 2004-08-25 01:20:18 +00:00
Mark Hammond eb619bb80b Fix for [ 1010677 ] thread Module Breaks PyGILState_Ensure(),
and a test case.
When booting a new thread, use the PyGILState API to manage the GIL.
2004-08-24 22:24:08 +00:00
Skip Montanaro 8107ca47eb Keep option parser from gobbling up the filename to be profiled and the
flags it accepts.  It's too late to change optparse's default behavior now,
but I find the default setting of allow_interspersed_args very weird.
2004-08-24 14:26:43 +00:00
Vinay Sajip fb154171c4 Fixed bug in DatagramHandler.send() 2004-08-24 09:36:23 +00:00
Raymond Hettinger a12fa148d7 Incorporate review comments courtesy of Neal Norwitz:
* Perform the code length check earlier.
* Eliminate the extra PyMem_Free() upon hitting an EXTENDED_ARG.
* Assert that the NOP count used in jump retargeting matches the NOPs
  eliminated in the final step.
* Add an XXX note to indicate that more work is being to done to
  handle linenotab with intervals > 255.
2004-08-24 04:34:16 +00:00