diff options
author | Karthikeyan Singaravelan <tir.karthi@gmail.com> | 2020-04-18 21:49:32 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-18 21:49:32 +0530 |
commit | 696136b993e11b37c4f34d729a0375e5ad544ade (patch) | |
tree | 19b1085d34db9d665b8f131e3f99bd0c2a40fcb6 /Lib/test/test_pydoc.py | |
parent | ce578831a4e573eac422a488930100bc5380f227 (diff) | |
download | cpython-git-696136b993e11b37c4f34d729a0375e5ad544ade.tar.gz |
bpo-35113: Fix inspect.getsource to return correct source for inner classes (#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.
Diffstat (limited to 'Lib/test/test_pydoc.py')
-rw-r--r-- | Lib/test/test_pydoc.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index 6d358f4fe2..ffabb7f1b9 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -476,6 +476,7 @@ class PydocDocTest(unittest.TestCase): def test_non_str_name(self): # issue14638 # Treat illegal (non-str) name like no name + class A: __name__ = 42 class B: |