Skip to content

Commit 382e753

Browse files
committed
squash! BUG: Rewrite inspect.unwrap() to respect classes
Fix flake8 errors
1 parent f6403dc commit 382e753

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

pdoc/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ def docfilter(obj, _filters=args.filter.strip().split(',')):
574574
_print_pdf(modules, **template_config)
575575
import textwrap
576576
PANDOC_CMD = textwrap.indent(_PANDOC_COMMAND, ' ')
577-
print(f"""
577+
help_msg = f"""
578578
PDF-ready markdown written to standard output.
579579
^^^^^^^^^^^^^^^
580580
Convert this file to PDF using e.g. Pandoc:
@@ -600,7 +600,7 @@ def docfilter(obj, _filters=args.filter.strip().split(',')):
600600
wkhtmltopdf --encoding utf8 -s A4 --print-media-type pdf.html pdf.pdf
601601
602602
or similar, at your own discretion.""",
603-
file=sys.stderr)
603+
print(help_msg, file=sys.stderr)
604604
sys.exit(0)
605605

606606
for module in modules:

pdoc/test/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,6 @@ def test__pdoc__dict(self):
659659
self.assertEqual(cm, [])
660660
self.assertNotIn('downloaded_modules', mod.doc)
661661

662-
# flake8: noqa: E501 line too long
663662
def test_class_wrappers(self):
664663
"""
665664
Check that decorated classes are unwrapped properly.
@@ -685,15 +684,15 @@ def test_class_wrappers(self):
685684
"""This is `DecoratedClassParent` class.""")
686685
self.assertEqual(root_wrapped_cls_child.qualname, 'DecoratedClassChild')
687686
self.assertEqual(root_wrapped_cls_child.docstring,
688-
"""This is an `DecoratedClassParent`'s implementation that always returns 1.""")
687+
"""This is an `DecoratedClassParent`'s implementation that always returns 1.""") # noqa: E501 [LineTooLong]
689688

690689
self.assertEqual(module_classdef.qualname, f'{module_name}.class_definition')
691690
self.assertEqual(module_classdef_cls_parent.qualname, 'DecoratedClassParent')
692691
self.assertEqual(module_classdef_cls_parent.docstring,
693692
"""This is `DecoratedClassParent` class.""")
694693
self.assertEqual(module_classdef_cls_child.qualname, 'DecoratedClassChild')
695694
self.assertEqual(module_classdef_cls_child.docstring,
696-
"""This is an `DecoratedClassParent`'s implementation that always returns 1.""")
695+
"""This is an `DecoratedClassParent`'s implementation that always returns 1.""") # noqa: E501 [LineTooLong]
697696

698697
self.assertEqual(module_util.qualname, f'{module_name}.util')
699698
self.assertEqual(module_util_decorator.qualname, 'decorate_class')

0 commit comments

Comments
 (0)