summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* Many updates to PEP 292 templates. Summary:Barry Warsaw2004-09-101-32/+82
| | | | | | | | | | | | | | | | | - Template no longer inherits from unicode. - SafeTemplate is removed. Now Templates have both a substitute() and a safe_substitute() method, so we don't need separate classes. No more __mod__() operator. - Adopt Tim Peter's idea for giving Template a metaclass, which makes the delimiter, the identifier pattern, or the entire pattern easy to override and document, while retaining efficiency of class-time compilation of the regexp. - More informative ValueError messages which will help a user narrow down the bogus delimiter to the line and column in the original string (helpful for long triple quoted strings).
* add tests that make sure buffer boundaries are handled properly for SGML ↵Fred Drake2004-09-082-0/+26
| | | | | | comments (see SF patch #901369)
* Remove usage of locale.getlocale in favor or setlocale(LC_NUMERIC, None) .Brett Cannon2004-09-081-3/+9
| | | | | | | Also added a comment about why the code is bother to see what setlocale thinks the set locale is. Closes bug #1023798.
* SF patch #998993: The UTF-8 and the UTF-16 stateful decoders now supportWalter Dörwald2004-09-071-1/+117
| | | | | | | | | | | decoding incomplete input (when the input stream is temporarily exhausted). codecs.StreamReader now implements buffering, which enables proper readline support for the UTF-16 decoders. codecs.StreamReader.read() has a new argument chars which specifies the number of characters to return. codecs.StreamReader.readline() and codecs.StreamReader.readlines() have a new argument keepends. Trailing "\n"s will be stripped from the lines if keepends is false. Added C APIs PyUnicode_DecodeUTF8Stateful and PyUnicode_DecodeUTF16Stateful.
* compiler.transformer: correct lineno attribute when possibleJeremy Hylton2004-09-072-3/+60
| | | | | | | | | | | | | | | | SF patch #1015989 The basic idea of this patch is to compute lineno attributes for all AST nodes. The actual implementation lead to a lot of restructing and code cleanup. The generated AST nodes now have an optional lineno argument to constructor. Remove the top-level asList(), since it didn't seem to serve any purpose. Add an __iter__ to ast nodes. Use isinstance() instead of explicit type tests. Change transformer to use the new lineno attribute, which replaces three lines of code with one. Use universal newlines so that we can get rid of special-case code for line endings. Use lookup_node() in a few more frequently called, but simple com_xxx methods(). Change string exception to class exception.
* Ported test__locale to unittest.Brett Cannon2004-09-061-26/+34
|
* SF #1022953: binascii.a2b_hqx("") raises SystemErrorRaymond Hettinger2004-09-061-0/+10
| | | | | | | | | | | | | Several functions adopted the strategy of altering a full lengthed string copy and resizing afterwards. That would fail if the initial string was short enough (0 or 1) to be interned. Interning precluded the subsequent resizing operation. The solution was to make sure the initial string was at least two characters long. Added tests to verify that all binascii functions do not crater when given an empty string argument.
* Fulfill Martin's request to use try/except rather than a "look beforeRaymond Hettinger2004-09-051-1/+5
| | | | you leap" approach. Makes the early call to os.urandom() unnecessary.
* Teach a test about the different kinds of functions.Raymond Hettinger2004-09-041-2/+2
|
* SF bug #1022010: Import random failsRaymond Hettinger2004-09-041-3/+6
| | | | | * Complete the previous patch by making sure that the MachineRandom tests are only run when the underlying resource is available.
* Change the strategy for coping with time intensive tests fromRaymond Hettinger2004-09-042-8/+17
| | | | | | | | "all or none" to "all or some". This provides much greater test coverage without eating much time. It also makes it more likely that routine regression testing will unearth bugs.
* Added IGNORE_EXCEPTION_DETAIL comparison option. The need is explainedTim Peters2004-09-041-0/+37
| | | | | | | | in the new docs. DocTestRunner.__run: Separate the determination of the example outcome from reporting that outcome, to squash brittle code duplication and excessive nesting.
* Fixing bug #817234, which made SRE get into an infinite loop onGustavo Niemeyer2004-09-031-0/+16
| | | | | empty final matches with finditer(). New test cases included for this bug and for #581080.
* Applying modified version of patch #1018386, which fixesGustavo Niemeyer2004-09-031-0/+53
| | | | some escaping bugs in SRE.
* Whitespace normalization.Tim Peters2004-09-011-3/+3
|
* Missed some occurrences of test_mpzAndrew M. Kuchling2004-08-311-3/+0
|
* Remove test output for rotor, xreadlineAndrew M. Kuchling2004-08-312-9/+0
|
* Remove test for mpzAndrew M. Kuchling2004-08-311-89/+0
|
* Remove tests for mpz, rotor, xreadlinesAndrew M. Kuchling2004-08-313-84/+0
|
* Use multi-line importAndrew M. Kuchling2004-08-311-4/+4
|
* SF patch #1007189, multi-line imports, for instance:Anthony Baxter2004-08-314-2/+62
| | | | | "from blah import (foo, bar baz, bongo)"
* Changed Karatsuba cutoff to match current reality.Tim Peters2004-08-301-1/+1
|
* Patch #941486: add os.path.lexists(). Also fix bug #940578 by using lexists ↵Johannes Gijsbers2004-08-302-0/+12
| | | | in glob.glob.
* Teach the random module about os.urandom().Raymond Hettinger2004-08-301-0/+102
| | | | | * Use it for seeding when it is available. * Provide an alternate generator based on it.
* 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
|