@@ -209,7 +209,7 @@ def test_html_multiple_files(self):
209
209
def test_html_identifier (self ):
210
210
for package in ('' , '._private' ):
211
211
with self .subTest (package = package ), \
212
- self .assertWarns (UserWarning ) as cm :
212
+ self .assertWarns (UserWarning ) as cm :
213
213
with run_html (EXAMPLE_MODULE + package , filter = 'A' ,
214
214
config = 'show_source_code=False' ):
215
215
self ._check_files (['A' ], ['CONST' , 'B docstring' ])
@@ -379,6 +379,7 @@ class ApiTest(unittest.TestCase):
379
379
"""
380
380
Programmatic/API unit tests.
381
381
"""
382
+
382
383
def setUp (self ):
383
384
pdoc .reset ()
384
385
@@ -398,7 +399,7 @@ def test_module(self):
398
399
399
400
def test_import_filename (self ):
400
401
with patch .object (sys , 'path' , ['' ]), \
401
- chdir (os .path .join (TESTS_BASEDIR , EXAMPLE_MODULE )):
402
+ chdir (os .path .join (TESTS_BASEDIR , EXAMPLE_MODULE )):
402
403
pdoc .import_module ('index' )
403
404
404
405
def test_imported_once (self ):
@@ -702,6 +703,7 @@ def __init__(self):
702
703
703
704
class C :
704
705
"""foo"""
706
+
705
707
def __init__ (self ):
706
708
"""bar"""
707
709
@@ -730,6 +732,12 @@ def __init__(self, x):
730
732
with patch .dict (mod .obj .__pdoc__ , {'C.__init__' : False }):
731
733
self .assertEqual (pdoc .Class ('C' , mod , C ).params (), [])
732
734
735
+ # test case for https://github.com/pdoc3/pdoc/issues/124
736
+ class C2 :
737
+ __signature__ = inspect .signature (lambda a , b , c = None , * , d = 1 , e : None )
738
+
739
+ self .assertEqual (pdoc .Class ('C2' , mod , C2 ).params (), ['a' , 'b' , 'c=None' , '*' , 'd=1' , 'e' ])
740
+
733
741
def test_url (self ):
734
742
mod = pdoc .Module (EXAMPLE_MODULE )
735
743
pdoc .link_inheritance ()
@@ -782,6 +790,7 @@ class HtmlHelpersTest(unittest.TestCase):
782
790
"""
783
791
Unit tests for helper functions for producing HTML.
784
792
"""
793
+
785
794
def test_minify_css (self ):
786
795
css = 'a { color: white; } /*comment*/ b {;}'
787
796
minified = minify_css (css )
0 commit comments