summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* Whitespace normalization. test_difflib passes again.Tim Peters2004-08-292-70/+70
|
* Reverting whitespace normalization. test_difflib fails with it -- theTim Peters2004-08-291-16/+16
| | | | | test depends on invisible trailing whitespace in .py files. The author will have to repair that.
* Whitespace normalization.Tim Peters2004-08-292-17/+17
|
* Patch #914575: difflib side by side diff support, diff.py s/b/s HTML option.Martin v. Löwis2004-08-292-2/+652
|
* Patch #934711: Expose platform-specific entropy.Martin v. Löwis2004-08-291-0/+11
|
* SF feature request #992967: array.array objects should support sequences.Raymond Hettinger2004-08-291-3/+35
| | | | Made the constructor accept general iterables.
* Whitespace normalization.Tim Peters2004-08-291-2/+2
|
* Added an __iter__ method for test suites.Jim Fulton2004-08-281-0/+31
|
* setUp and tearDown functions are now passed the test objectJim Fulton2004-08-281-2/+2
|
* - setUp and tearDown functions are now passed the test objectJim Fulton2004-08-281-5/+111
| | | | | - Added a set_unittest_reportflags to set default reporting flags used when running doctests under unittest control.
* Removed old "if 0:" block for leak detection; wouldn't work anymore anyway.Tim Peters2004-08-271-8/+1
|
* Don't really need ellipsis doctests for the syntax errors, becauseTim Peters2004-08-271-12/+12
| | | | | | 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).
* Removed outdated commentEdward Loper2004-08-271-2/+0
|
* Fixed 6 failures due to doctest changes.Tim Peters2004-08-271-16/+16
|
* test_bug1001011(): Verify thatTim Peters2004-08-271-5/+33
| | | | | | | | | 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.
* - Removed redundant call to expandtabs in DocTestParesr.Edward Loper2004-08-271-51/+114
| | | | | | | | | | | | | | - 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.
* - Added DocTestParser.parse(), which parses a docstring into ExamplesEdward Loper2004-08-261-2/+57
| | | | | | | | | 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
* Move test_bug1001011() to string_tests.MixinStrUnicodeTest so thatWalter Dörwald2004-08-264-24/+23
| | | | | | 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)
* output_difference(): In fancy-diff cases, the way this split expected &Tim Peters2004-08-261-7/+3
| | | | | | | | 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.
* Whitespace normalization.Tim Peters2004-08-262-6/+5
|
* Remove unnecessary line.Raymond Hettinger2004-08-261-1/+0
|
* Added REPORT_ONLY_FIRST_FAILURE flag, which supresses output after theEdward Loper2004-08-261-0/+81
| | | | first failing example in each test.
* Renamed UNIFIED_DIFF->REPORT_UDIFF; CONTEXT_DIFF->REPORT_CDIFF; andEdward Loper2004-08-261-7/+7
| | | | | | | 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).
* Shortened diff output for unified & context diffsEdward Loper2004-08-261-6/+2
|
* - Changed the output of report_start() and report_unexpected_exception()Edward Loper2004-08-261-22/+40
| | | | | | | 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
* Patch #1014930. Expose current parse location to XMLParser.Dave Cole2004-08-261-0/+39
|
* Added an "exc_msg" attribute to Example (containing the expectedEdward Loper2004-08-261-16/+77
| | | | | | | | | 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.
* Only recognize the expected output as an exception if it *starts* withEdward Loper2004-08-251-3/+13
| | | | | | | | 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.
* PEP 292 classes Template and SafeTemplate are added to the string module.Barry Warsaw2004-08-251-0/+84
| | | | | | | | 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.
* Stop producing or using OverflowWarning. PEP 237 thought this wouldTim Peters2004-08-252-7/+9
| | | | | | | 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.
* Fix for [ 1010677 ] thread Module Breaks PyGILState_Ensure(),Mark Hammond2004-08-241-0/+4
| | | | | and a test case. When booting a new thread, use the PyGILState API to manage the GIL.
* SF Patch #1013667: Cleanup Peepholer OutputRaymond Hettinger2004-08-232-2/+104
| | | | | | | | | * 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.
* SF Patch #1007087: Return new string for single subclass joins (Bug #1001011)Raymond Hettinger2004-08-231-0/+23
| | | | | | | (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.
* test_DocTestFinder(): This test failed when test_doctest was runTim Peters2004-08-231-2/+5
| | | | | directly, due to assuming a filename specific to running tests "the normal way". +ELLIPSIS to the rescue!
* Moved some test cases from doctest to test_doctest.Tim Peters2004-08-231-2/+126
|
* Flush bz2 data even if nothing had been written so far. Fixes #1013882.Martin v. Löwis2004-08-221-1/+7
| | | | Will backport to 2.3.
* Fix repr for negative imaginary part. Fixes #1013908.Martin v. Löwis2004-08-221-0/+1
|
* Added NDIFF_DIFF option.Tim Peters2004-08-221-3/+29
|
* Bugs fixed:Jim Fulton2004-08-221-56/+115
| | | | | | | | | | | | | | | - 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)
* _ellipsis_match(): Removed special-casing of "...\n". The semanticsTim Peters2004-08-221-28/+5
| | | | | | 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.
* Patch 1012740: cStringIO's truncate doesn'tTim Peters2004-08-211-1/+2
| | | | | | | | | | | | | 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.
* Whitespace normalization.Tim Peters2004-08-203-5/+5
|
* Stab at SF 1010777: test_queue fails occasionallyTim Peters2004-08-201-14/+53
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Semantic-neutral format and comment changes.Tim Peters2004-08-201-14/+16
|
* Now that they've settled down, document doctest directives.Tim Peters2004-08-191-3/+17
|
* Port test_zipfile to unittest (patch #736962).Johannes Gijsbers2004-08-191-98/+98
|
* Replaced the ELLIPSIS implementation with a worst-case linear-time one.Tim Peters2004-08-191-8/+20
|
* ELLIPSIS implementation: an ellipsis couldn't match nothing if itTim Peters2004-08-191-0/+23
| | | | | | | 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.
* Rewrite test_order so as to be more "proper". Originally relied on anBrett Cannon2004-08-191-7/+13
| | | | | | 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.
* Add support for FreeBSD 6.Hye-Shik Chang2004-08-183-2/+7
|