summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_doctest.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-40636: Clarify the zip built-in docstring. (GH-20118)Miss Islington (bot)2020-05-151-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Clarify the zip built-in docstring. This puts much simpler text up front along with an example. As it was, the zip built-in docstring was technically correct. But too technical for the reader who shouldn't _need_ to know about `__next__` and `StopIteration` as most people do not need to understand the internal implementation details of the iterator protocol in their daily life. This is a documentation only change, intended to be backported to 3.8; it is only tangentially related to PEP-618 which might offer new behavior options in the future. Wording based a bit more on enumerate per Brandt's suggestion. This gets rid of the legacy wording paragraph which seems too tied to implementation details of the iterator protocol which isn't relevant here. Co-authored-by: Brandt Bucher <brandtbucher@gmail.com> (cherry picked from commit 6a5d3ff67644af42b1a781be2eacb2e82913441c) Co-authored-by: Gregory P. Smith <greg@krypto.org>
* bpo-1812: Fix newline conversion when doctest.testfile loads from a package ↵Miss Islington (bot)2020-03-261-4/+89
| | | | | | | | whose loader has a get_data method (GH-17385) This pull request fixes the newline conversion bug originally reported in bpo-1812. When that issue was originally submitted, the open builtin did not default to universal newline mode; now it does, which makes the issue fix simpler, since the only code path that needs to be changed is the one in doctest._load_testfile where the file is loaded from a package whose loader has a get_data method. (cherry picked from commit e0b8101492f6c61dee831425b4d3dae39a953599) Co-authored-by: Peter Donis <peterdonis@alum.mit.edu>
* bpo-36406: Handle namespace packages in doctest (GH-12520) (GH-17591)Miss Islington (bot)2019-12-131-1/+5
| | | | | (cherry picked from commit 8289e27393395ee903bd096d42e07c112d7f15c6) Co-authored-by: Xtreak <tir.karthi@gmail.com>
* bpo-22385: Support output separators in hex methods. (#13578)Gregory P. Smith2019-05-291-1/+4
| | | | | | | | | | | | | | | | | | * bpo-22385: Support output separators in hex methods. Also in binascii.hexlify aka b2a_hex. The underlying implementation behind all hex generation in CPython uses the same pystrhex.c implementation. This adds support to bytes, bytearray, and memoryview objects. The binascii module functions exist rather than being slated for deprecation because they return bytes rather than requiring an intermediate step through a str object. This change was inspired by MicroPython which supports sep in its binascii implementation (and does not yet support the .hex methods). https://bugs.python.org/issue22385
* bpo-24746: Fix doctest failures when running the testsuite with -R (#11501)Pablo Galindo2019-01-101-2/+1
|
* bpo-24746: Avoid stripping trailing whitespace in doctest fancy diff (#10639)Sanyam Khurana2019-01-091-1/+47
|
* bpo-12458: Fix line numbers for multiline expressions. (GH-8774)Serhiy Storchaka2018-09-171-1/+1
|
* bpo-33073: Adding as_integer_ratio to ints. (GH-8750)Lisa Roach2018-09-141-1/+2
|
* bpo-33053: -m now adds *starting* directory to sys.path (GH-6231)Nick Coghlan2018-03-251-5/+11
| | | | | | | | | | | | Historically, -m added the empty string as sys.path zero, meaning it resolved imports against the current working directory, the same way -c and the interactive prompt do. This changes the sys.path initialisation to add the *starting* working directory as sys.path[0] instead, such that changes to the working directory while the program is running will have no effect on imports when using the -m switch.
* bpo-32991: Restore expectation that inspect.getfile raises TypeError on ↵Jason R. Coombs2018-03-051-1/+18
| | | | | | | | | | namespace package (GH-5980) * bpo-32991: Add test capturing expectation. DocTestFinder.find should return an empty list for doctests in a namespace package. * bpo-32991: Restore expectation that inspect.getfile on a namespace package raises TypeError.
* bpo-32677: Add .isascii() to str, bytes and bytearray (GH-5342)INADA Naoki2018-01-271-1/+1
|
* #27364: fix "incorrect" uses of escape character in the stdlib.R David Murray2016-09-081-1/+1
| | | | | | | And most of the tools. Patch by Emanual Barry, reviewed by me, Serhiy Storchaka, and Martin Panter.
* Backed out changeset af29d89083b3 (closes #25548) (closes #27498)Benjamin Peterson2016-07-141-1/+1
|
* Issue #18300: Merge from 3.5Berker Peksag2016-06-241-15/+9
|\
| * Issue #18300: Set TERM='' by default in assert_python_*Berker Peksag2016-06-241-15/+9
| |
* | Issue #25548: Showing memory address of class objects in replKushal Das2016-06-041-1/+1
| |
* | Issue #27076: Merge spelling from 3.5Martin Panter2016-05-261-1/+1
|\ \ | |/
| * Issue #27076: Doc, comment and tests spelling fixesMartin Panter2016-05-261-1/+1
| | | | | | | | Most fixes to Doc/ and Lib/ directories by Ville Skyttä.
* | Issue #23277: Remove unused imports in tests.Serhiy Storchaka2016-04-241-3/+1
| |
* | test_doctest: remove unused importsVictor Stinner2016-03-251-2/+1
|/
* Issue #26304: Change "allows to <verb>" to "allows <verb>ing" or similarMartin Panter2016-02-101-1/+1
| | | | | The original form is incorrect grammar and feels awkward, even though the meaning is clear.
* Fix test_doctest in verbose modeVictor Stinner2015-12-021-2/+2
|
* Issue #9517: Move script_helper to the support package.Berker Peksag2015-05-061-4/+4
| | | | Patch by Christie Wilson.
* Implements issue #9951: Adds a hex() method to bytes, bytearray, & memoryview.Gregory P. Smith2015-04-251-1/+1
| | | | | | | Also updates a few internal implementations of the same thing to use the new built-in code. Contributed by Arnon Yaari.
* Issue #23943: Fix typos. Patch by Piotr Kasprzyk.Berker Peksag2015-04-141-2/+2
|\
| * Issue #23943: Fix typos. Patch by Piotr Kasprzyk.Berker Peksag2015-04-141-2/+2
| |
* | Open files in binary mode to avoid newlines transformation.Serhiy Storchaka2015-04-041-4/+4
|\ \ | |/
| * Open files in binary mode to avoid newlines transformation.Serhiy Storchaka2015-04-041-4/+4
| |
* | Issue #21740: Support wrapped callables in pydoc. Patch by Claudiu Popa.Yury Selivanov2014-12-081-1/+18
| |
* | Merge: #8473: Add tests that doctest uses universal newlines in testfile.R David Murray2014-10-031-0/+30
|\ \ | |/
| * #8473: Add tests that doctest uses universal newlines in testfile.R David Murray2014-10-031-0/+30
| | | | | | | | Python3 does not have the bug covered by the issue.
* | Issue8297: module attribute lookup failures now include module name in error ↵Ethan Furman2014-04-241-2/+2
| | | | | | | | message.
* | #15916: if there are no docstrings, make empty suite, not an error.R David Murray2014-04-151-15/+18
| | | | | | | | | | | | | | | | | | | | This makes doctest work like unittest: if the test case is empty, that just means there are zero tests run, it's not an error. The existing behavior was broken, since it only gave an error if there were *no* docstrings, and zero tests run if there were docstrings but none of them contained tests. So this makes it self-consistent as well. Patch by Glenn Jones.
* | fix #21076: turn signal module constants into enumsGiampaolo Rodola'2014-04-041-1/+1
|/
* Issue #19138: doctest's IGNORE_EXCEPTION_DETAIL now allows no detail at all.Tim Peters2013-12-041-0/+27
|
* Issue #3158: Relax new doctests a bit.Zachary Ware2013-11-241-4/+9
| | | | | | | Apparently, the number of objects with docstrings in builtins varies with --with-pydebug (non-debug has one fewer). Also, skip the new tests entirely if built --without-doc-strings.
* Issue #3158: doctest can now find doctests in functions and methodsZachary Ware2013-11-241-0/+29
| | | | | | | | written in C. As a part of this, a few doctests have been added to the builtins module (on hex(), oct(), and bin()), a doctest has been fixed (hopefully on all platforms) on float, and test_builtins now runs doctests in builtins.
* #11390: fix test failures due to readline and windows lineneds.R David Murray2013-06-251-22/+30
|
* #11390: convert doctest CLI to argparse and add -o and -f options.R David Murray2013-06-231-0/+226
| | | | | | This provides a way to specify arbitrary doctest options when using the CLI interface to process test files, just as one can when calling testmod or testfile programmatically.
* #16522: Add FAIL_FAST flag to doctest.R David Murray2012-11-211-2/+45
| | | | Patch by me, most of the work (doc and tests) by Daniel Urban.
* Merge #14649: clarify DocTestSuite error when there are no docstrings.R David Murray2012-09-101-0/+25
|\ | | | | | | | | | | | | Also adds tests to verify the documented behavior (which is probably a bug, as indicated in the added comments). Patch by Chris Jerdonek.
| * #14649: clarify DocTestSuite error when there are no docstrings.R David Murray2012-09-101-0/+25
| | | | | | | | | | | | | | Also adds tests to verify the documented behavior (which is probably a bug, as indicated in the added comments). Patch by Chris Jerdonek.
* | Implemented PEP 405 (Python virtual environments).Vinay Sajip2012-05-261-1/+1
| |
* | Followup to #7502: add __hash__ method and tests.Antoine Pitrou2011-12-181-0/+19
|\ \ | |/
| * Followup to #7502: add __hash__ method and tests.Antoine Pitrou2011-12-181-0/+19
| |
* | Issue #7502: Fix equality comparison for DocTestCase instances.Antoine Pitrou2011-12-181-0/+40
|\ \ | |/ | | | | Patch by Cédric Krier.
| * Issue #7502: Fix equality comparison for DocTestCase instances.Antoine Pitrou2011-12-181-0/+40
| | | | | | | | Patch by Cédric Krier.
* | #11565: Merge with 3.2.Ezio Melotti2011-03-161-5/+5
|\ \ | |/
| * #11565: Merge with 3.1.Ezio Melotti2011-03-161-5/+5
| |\
| | * #11565: Fix several typos. Patch by Piotr Kasprzyk.Ezio Melotti2011-03-161-5/+5
| | |