@@ -390,6 +390,7 @@ def test_getclasses(self):
390390 ('ParrotDroppings' , mod .ParrotDroppings ),
391391 ('StupidGit' , mod .StupidGit ),
392392 ('Tit' , mod .MalodorousPervert ),
393+ ('WhichComments' , mod .WhichComments ),
393394 ])
394395 tree = inspect .getclasstree ([cls [1 ] for cls in classes ])
395396 self .assertEqual (tree ,
@@ -403,7 +404,8 @@ def test_getclasses(self):
403404 [(mod .FesteringGob , (mod .MalodorousPervert ,
404405 mod .ParrotDroppings ))
405406 ]
406- ]
407+ ],
408+ (mod .WhichComments , (object ,),)
407409 ]
408410 ])
409411 tree = inspect .getclasstree ([cls [1 ] for cls in classes ], True )
@@ -415,7 +417,8 @@ def test_getclasses(self):
415417 [(mod .FesteringGob , (mod .MalodorousPervert ,
416418 mod .ParrotDroppings ))
417419 ]
418- ]
420+ ],
421+ (mod .WhichComments , (object ,),)
419422 ]
420423 ])
421424
@@ -646,6 +649,18 @@ def test_anonymous(self):
646649 # as argument to another function.
647650 self .assertSourceEqual (mod2 .anonymous , 55 , 55 )
648651
652+ class TestBlockComments (GetSourceBase ):
653+ fodderModule = mod
654+
655+ def test_toplevel_class (self ):
656+ self .assertSourceEqual (mod .WhichComments , 96 , 114 )
657+
658+ def test_class_method (self ):
659+ self .assertSourceEqual (mod .WhichComments .f , 99 , 104 )
660+
661+ def test_class_async_method (self ):
662+ self .assertSourceEqual (mod .WhichComments .asyncf , 109 , 112 )
663+
649664class TestBuggyCases (GetSourceBase ):
650665 fodderModule = mod2
651666
@@ -4014,8 +4029,8 @@ def test_getsource_reload(self):
40144029
40154030def test_main ():
40164031 run_unittest (
4017- TestDecorators , TestRetrievingSourceCode , TestOneliners , TestBuggyCases ,
4018- TestInterpreterStack , TestClassesAndFunctions , TestPredicates ,
4032+ TestDecorators , TestRetrievingSourceCode , TestOneliners , TestBlockComments ,
4033+ TestBuggyCases , TestInterpreterStack , TestClassesAndFunctions , TestPredicates ,
40194034 TestGetcallargsFunctions , TestGetcallargsMethods ,
40204035 TestGetcallargsUnboundMethods , TestGetattrStatic , TestGetGeneratorState ,
40214036 TestNoEOL , TestSignatureObject , TestSignatureBind , TestParameterObject ,
0 commit comments