diff options
Diffstat (limited to 'Lib/test/test_inspect.py')
| -rw-r--r-- | Lib/test/test_inspect.py | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py index 71c4f27..172e6bf 100644 --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -390,6 +390,7 @@ class TestRetrievingSourceCode(GetSourceBase): ('ParrotDroppings', mod.ParrotDroppings), ('StupidGit', mod.StupidGit), ('Tit', mod.MalodorousPervert), + ('WhichComments', mod.WhichComments), ]) tree = inspect.getclasstree([cls[1] for cls in classes]) self.assertEqual(tree, @@ -403,7 +404,8 @@ class TestRetrievingSourceCode(GetSourceBase): [(mod.FesteringGob, (mod.MalodorousPervert, mod.ParrotDroppings)) ] - ] + ], + (mod.WhichComments, (object,),) ] ]) tree = inspect.getclasstree([cls[1] for cls in classes], True) @@ -415,7 +417,8 @@ class TestRetrievingSourceCode(GetSourceBase): [(mod.FesteringGob, (mod.MalodorousPervert, mod.ParrotDroppings)) ] - ] + ], + (mod.WhichComments, (object,),) ] ]) @@ -646,6 +649,18 @@ class TestOneliners(GetSourceBase): # as argument to another function. self.assertSourceEqual(mod2.anonymous, 55, 55) +class TestBlockComments(GetSourceBase): + fodderModule = mod + + def test_toplevel_class(self): + self.assertSourceEqual(mod.WhichComments, 96, 114) + + def test_class_method(self): + self.assertSourceEqual(mod.WhichComments.f, 99, 104) + + def test_class_async_method(self): + self.assertSourceEqual(mod.WhichComments.asyncf, 109, 112) + class TestBuggyCases(GetSourceBase): fodderModule = mod2 @@ -4014,8 +4029,8 @@ def foo(): def test_main(): run_unittest( - TestDecorators, TestRetrievingSourceCode, TestOneliners, TestBuggyCases, - TestInterpreterStack, TestClassesAndFunctions, TestPredicates, + TestDecorators, TestRetrievingSourceCode, TestOneliners, TestBlockComments, + TestBuggyCases, TestInterpreterStack, TestClassesAndFunctions, TestPredicates, TestGetcallargsFunctions, TestGetcallargsMethods, TestGetcallargsUnboundMethods, TestGetattrStatic, TestGetGeneratorState, TestNoEOL, TestSignatureObject, TestSignatureBind, TestParameterObject, |
