| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
test depends on invisible trailing whitespace in .py files. The author will
have to repair that.
|
| |
|
| |
|
| |
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
directly, due to assuming a filename specific to running tests "the
normal way". +ELLIPSIS to the rescue!
|
| |
|
|
|
|
| |
Will backport to 2.3.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Test filenames sometimes had trailing .pyc or .pyo sufixes
(when module __file__ did).
- Trailing spaces spaces in expected output were dropped.
New default failure format:
- Separation of examples from file info makes examples easier to see
- More vertical separation, improving readability
- Emacs-recognized file info (also closer to Python exception format)
|
|
|
|
|
|
| |
are non-obvious either way because the newline character "is invisible",
but it's still there all the same, and it's easier to explain/predict
if that reality is left alone.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
truncate() left the stream position unchanged, which meant the
"truncated" data didn't go away:
>>> io.write('abc')
>>> io.truncate(0)
>>> io.write('xyz')
>>> io.getvalue()
'abcxyz'
Patch by Dima Dorfman.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
test_queue has failed occasionally for years, and there's more than one
cause.
The primary cause in the SF report appears to be that the test driver
really needs entirely different code for thread tests that expect to
raise exceptions than for thread tests that are testing non-exceptional
blocking semantics. So gave them entirely different code, and added a
ton of explanation.
Another cause is that the blocking thread tests relied in several places
on the difference between sleep(.1) and sleep(.2) being long enough for
the trigger thread to do its stuff sot that the blocking thread could make
progress. That's just not reliable on a loaded machine. Boosted the 0.2's
to 10.0's instead, which should be long enough under any non-catastrophic
system conditions. That doesn't make the test take longer to run, the 10.0
is just how long the blocking thread is *willing* to wait for the trigger
thread to do something. But if the Queue module is plain broken, such
tests will indeed take 10 seconds to fail now.
For similar (heavy load) reasons, changed threaded-test termination to
be willing to wait 10 seconds for the signal thread to end too.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
appeared at the end of a line. Repaired that. Also noted that it's
too easy to provoke this implementation into requiring exponential
time, and especially when a test fails. I'll replace the implementation
with an always-efficient one later.
|
|
|
|
|
|
| |
error based on decorating with staticmethod too soon for the code to execute.
This meant that if the test didn't pass it just errored out. Now if the test
doesn't pass it leads to a failure instead.
|
| |
|