summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pydoc.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.10] bpo-44559: [Enum] revert enum module to 3.9 (GH-27010)Ethan Furman2021-07-041-1/+1
| | | * [Enum] revert enum module to 3.9
* bpo-38605: Revert making 'from __future__ import annotations' the default ↵Pablo Galindo2021-04-211-2/+2
| | | | | | (GH-25490) This reverts commits 044a1048ca93d466965afc027b91a5a9eb9ce23c and 1be456ae9d53bb1cba2b24fc86175c282d1c2169, adapting the code to changes that happened after it.
* bpo-43682: Make staticmethod objects callable (GH-25117)Victor Stinner2021-04-111-1/+1
| | | Static methods (@staticmethod) are now callable as regular functions.
* bpo-43682: @staticmethod inherits attributes (GH-25268)Victor Stinner2021-04-091-2/+4
| | | | | | | | | | Static methods (@staticmethod) and class methods (@classmethod) now inherit the method attributes (__module__, __name__, __qualname__, __doc__, __annotations__) and have a new __wrapped__ attribute. Changes: * Add a repr() method to staticmethod and classmethod types. * Add tests on the @classmethod decorator.
* bpo-40066: Enum: modify `repr()` and `str()` (GH-22392)Ethan Furman2021-03-311-1/+1
| | | | | | | | | * Enum: streamline repr() and str(); improve docs - repr() is now ``enum_class.member_name`` - stdlib global enums are ``module_name.member_name`` - str() is now ``member_name`` - add HOW-TO section for ``Enum`` - change main documentation to be an API reference
* bpo-42988: Remove the pydoc getfile feature (GH-25015)Victor Stinner2021-03-291-6/+0
| | | | | | | CVE-2021-3426: Remove the "getfile" feature of the pydoc module which could be abused to read arbitrary files on the disk (directory traversal vulnerability). Moreover, even source code of Python modules can contain sensitive data like passwords. Vulnerability reported by David Schwörer.
* bpo-38605: Make 'from __future__ import annotations' the default (GH-20434)Batuhan Taskaya2020-10-061-2/+2
| | | | | The hard part was making all the tests pass; there are some subtle issues here, because apparently the future import wasn't tested very thoroughly in previous Python versions. For example, `inspect.signature()` returned type objects normally (except for forward references), but strings with the future import. We changed it to try and return type objects by calling `typing.get_type_hints()`, but fall back on returning strings if that function fails (which it may do if there are future references in the annotations that require passing in a specific namespace to resolve).
* bpo-40275: Use new test.support helper submodules in tests (GH-21451)Hai Shi2020-08-031-8/+7
|
* bpo-40275: Adding threading_helper submodule in test.support (GH-20263)Hai Shi2020-05-271-2/+3
|
* bpo-35113: Fix inspect.getsource to return correct source for inner classes ↵Karthikeyan Singaravelan2020-04-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#10307) * Use ast module to find class definition * Add NEWS entry * Fix class with multiple children and move decorator code to the method * Fix PR comments 1. Use node.decorator_list to select decorators 2. Remove unwanted variables in ClassVisitor 3. Simplify stack management as per review * Add test for nested functions and async calls * Fix pydoc test since comments are returned now correctly * Set event loop policy as None to fix environment related change * Refactor visit_AsyncFunctionDef and tests * Refactor to use local variables and fix tests * Add patch attribution * Use self.addCleanup for asyncio * Rename ClassVisitor to ClassFinder and fix asyncio cleanup * Return first class inside conditional in case of multiple definitions. Remove decorator for class source. * Add docstring to make the test correct * Modify NEWS entry regarding decorators * Return decorators too for bpo-15856 * Move ast and the class source code to top. Use proper Exception.
* bpo-40257: Improve help for the typing module (GH-19546)Serhiy Storchaka2020-04-181-1/+2
| | | | | | * Show docstring for special forms. * Show docstring for special generic aliases. * Show documentation for __origin__ for generic aliases.
* bpo-40257: Output object's own docstring in pydoc (GH-19479)Serhiy Storchaka2020-04-151-1/+2
|
* bpo-38614: Use test.support.SHORT_TIMEOUT constant (GH-17566)Victor Stinner2019-12-111-1/+1
| | | | | | | | | | | | | | | Replace hardcoded timeout constants in tests with SHORT_TIMEOUT of test.support, so it's easier to ajdust this timeout for all tests at once. SHORT_TIMEOUT is 30 seconds by default, but it can be longer depending on --timeout command line option. The change makes almost all timeouts longer, except test_reap_children() of test_support which is made 2x shorter: SHORT_TIMEOUT should be enough. If this test starts to fail, LONG_TIMEOUT should be used instead. Uniformize also "from test import support" import in some test files.
* bpo-38786: Add parsing of https links to pydoc (GH-17143)Kirill2019-11-131-0/+11
|
* Remove unused imports in tests (GH-14518)Victor Stinner2019-07-011-1/+0
|
* bpo-36045: builtins.help() now prefixes `async` for async functions (GH-12010)Dan Rose2019-05-241-0/+23
| | | | | | Previously, it was hard to tell whether a function should be awaited. It was also incorrect (per PEP 484) to put this in the type hint for coroutine functions. Added this info to the output of builtins.help and pydoc. https://bugs.python.org/issue36045
* bpo-36729: Delete unused text variable on tests. (GH-12959)Emmanuel Arias2019-04-291-4/+0
|
* bpo-35619: Improve support of custom data descriptors in help() and pydoc. ↵Serhiy Storchaka2019-01-151-10/+164
| | | | (GH-11366)
* bpo-32492: Tweak _collections._tuplegetter. (GH-11367)Serhiy Storchaka2018-12-311-0/+10
| | | | | | * Replace the docstrings cache with sys.intern(). * Improve tests. * Unify names of tp_descr_get and tp_descr_set functions.
* bpo-35614: Fix pydoc help() on metaclasses (#11357)Sanyam Khurana2018-12-311-0/+11
|
* bpo-35513: Replace time.time() with time.monotonic() in tests (GH-11182)Victor Stinner2018-12-171-2/+2
| | | | | | | Replace time.time() with time.monotonic() in tests to measure time delta. test_zipfile64: display progress every minute (60 secs) rather than every 5 minutes (5*60 seconds).
* bpo-34966: Improve support of method aliases in pydoc. (GH-9823)Serhiy Storchaka2018-11-081-0/+99
| | | | Pydoc now does not duplicate docstrings for aliases of inherited methods.
* bpo-8525: help() on a type now shows builtin subclasses (GH-5066)Sanyam Khurana2018-10-211-0/+118
| | | | | For builtin types with builtin subclasses, help() on the type now shows up to 4 of the subclasses. This partially replaces the exception hierarchy information previously displayed in Python 2.7.
* bpo-34182: Fix test_pydoc running as a script. (GH-8389)Bo Bayles2018-07-291-1/+2
|
* bpo-33185: Improve wording and markup (GH-6477)Nick Coghlan2018-04-151-1/+1
| | | | | | Adds some working and markup fixes that I missed in the initial commit for this issue. (Follow-up to GH-6419)
* bpo-33185: Fix regression in pydoc CLI sys.path handling (GH-6419)Nick Coghlan2018-04-151-0/+67
| | | | | | | | | | The pydoc CLI assumed -m pydoc would add the empty string to sys.path, and hence got confused when it switched to adding the full initial working directory instead. This refactors the pydoc CLI path manipulation to be more testable, and ensures it won't accidentally remove the standard library directory containing pydoc itself from sys.path.
* bpo-32226: PEP 560: improve typing module (#4906)Ivan Levkivskyi2018-01-201-1/+1
| | | | This PR re-designs the internal typing API using the new PEP 560 features. However, there are only few minor changes in the public API.
* bpo-32031: Fix pydoc `test_mixed_case_module_names_are_lower_cased` (GH-4441)xdegaye2017-11-181-1/+1
| | | When there is a symlink in the directory path of the standard library.
* bpo-32018: Fix inspect.signature repr to follow PEP 8 (#4408)Dong-hee Na2017-11-151-1/+1
|
* bpo-31128: Allow pydoc to bind to arbitrary hostnames (#3011)Feanil Patel2017-09-141-2/+2
| | | | New -n flag allow overriding localhost with custom value, for example to run from containers.
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-5/+1
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* bpo-31028: Fix test_pydoc when run directly (#2864)Victor Stinner2017-07-271-1/+1
| | | | | | | | | | * bpo-31028: Fix test_pydoc when run directly Fix get_pydoc_link() of test_pydoc to fix "./python Lib/test/test_pydoc.py": get the absolute path to __file__ to prevent relative directories. * Use realpath() instead of abspath()
* bpo-29919: Remove unused imports found by pyflakes (#137)Victor Stinner2017-03-271-1/+0
| | | Make also minor PEP8 coding style fixes on modified imports.
* Issue #27989: Tweak inspect.formatannotation() to improve pydoc rendering of ↵Guido van Rossum2016-10-221-0/+13
|\ | | | | | | function annotations. Ivan L. (3.5->3.6)
| * Issue #27989: Tweak inspect.formatannotation() to improve pydoc rendering of ↵Guido van Rossum2016-10-221-0/+13
| | | | | | | | function annotations. Ivan L.
* | Issue #27985: Implement PEP 526 -- Syntax for Variable Annotations.Yury Selivanov2016-09-091-0/+4
| | | | | | | | Patch by Ivan Levkivskyi.
* | Issue #24254: Drop cls.__definition_order__.Eric Snow2016-09-081-7/+1
| |
* | Issue #15767: Use ModuleNotFoundError.Eric Snow2016-09-071-1/+1
| |
* | Issue #24254: Preserve class attribute definition order.Eric Snow2016-09-051-1/+7
| |
* | Issue #27366: Implement PEP 487Nick Coghlan2016-07-301-1/+2
| | | | | | | | | | | | - __init_subclass__ called when new subclasses defined - __set_name__ called when descriptors are part of a class definition
* | Issue #16484: Merge pydoc Windows fixes from 3.5Martin Panter2016-06-121-1/+1
|\ \ | |/
| * Issue #16484: Fix pydoc link and test on Windows, by Kaushik NadikuditiMartin Panter2016-06-121-1/+1
| |
* | Merge: #16484: Fix pydoc doc links to modules whose names are mixed case.R David Murray2016-06-031-0/+14
|\ \ | |/
| * #16484: Fix pydoc doc links to modules whose names are mixed case.R David Murray2016-06-031-0/+14
| | | | | | | | Patch by Sean Rodman, test by Kaushik N.
* | Issue #27076: Merge spelling from 3.5Martin Panter2016-05-261-2/+2
|\ \ | |/
| * Issue #27076: Doc, comment and tests spelling fixesMartin Panter2016-05-261-2/+2
| | | | | | | | Most fixes to Doc/ and Lib/ directories by Ville Skyttä.
* | Issue #18010: Merge pydoc web search fix from 3.5Martin Panter2015-11-061-6/+32
|\ \ | |/
| * Issue #18010: Merge pydoc web search fix from 3.4 into 3.5Martin Panter2015-11-061-6/+32
| |\
| | * Issue #18010: Fix pydoc web server search to handle package exceptionsMartin Panter2015-11-061-6/+32
| | | | | | | | | | | | Implementation by Antoine Pitrou.
* | | Issue #24879: Teach pydoc to display named tuple fields in the order they ↵Raymond Hettinger2015-08-191-0/+16
|/ / | | | | | | were defined.