| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
Made the constructor accept general iterables.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
- Added a set_unittest_reportflags to set default reporting flags used
when running doctests under unittest control.
|
| |
|
|
|
|
|
|
| |
this module imports itself explicitly from test (so the "file names"
current doctest synthesizes for examples don't vary depending on how
test_generators is run).
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
s.join([t]) is t
for (s, t) in (str, str), (unicode, unicode), and (str, unicode).
For (unicode, str), verify that it's *not* t (the result is promoted
to unicode instead). Also verify that when t is a subclass of str or
unicode that "the right thing" happens.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
first failing example in each test.
|
|
|
|
|
|
|
| |
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).
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
| |
Will backport to 2.3.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
and a test case.
When booting a new thread, use the PyGILState API to manage the GIL.
|
| |
|
|
|
|
|
|
|
|
|
| |
* Make a pass to eliminate NOPs. Produce code that is more readable,
more compact, and a tiny bit faster. Makes the peepholer more flexible
in the scope of allowable transformations.
* With Guido's okay, bumped up the magic number so that this patch gets
widely exercised before the alpha goes out.
|
|
|
|
|
|
|
| |
(Patch contributed by Nick Coghlan.)
Now joining string subtypes will always return a string.
Formerly, if there were only one item, it was returned unchanged.
|
|
|
|
|
| |
is_private in its tests failed if doctest.py was run directly. Now
it works.
|
|
|
|
|
| |
directly, due to assuming a filename specific to running tests "the
normal way". +ELLIPSIS to the rescue!
|
| |
|
| |
|
|
|
|
|
|
|
| |
NamedTemporaryFile (which can't work for this function's purposes on
Windows). Leaving temp files behind wasn't a great idea either, though,
so try to clean up. At least the test suite no longer leaves any of
these guys behind now.
|
| |
|
|
|
|
| |
Will backport to 2.3.
|
| |
|
|
|
|
|
|
|
|
|
| |
docstrings toward being a lot shorter, and telling the whole truth in
the manual instead. This change is an example: the manual has detailed
explanations of the option names now, so it's Bad to repeat them in
the docstring (two detailed descriptions are certain to get out of synch).
Just listing the names has memory-jogging benefits, though, so that's
still helpful in the docstring.
|
| |
|
| |
|