Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
repos:
- repo: https://github.com/psf/black
rev: 20.8b1
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.1.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: "3.8.4"
rev: "7.3.0"
hooks:
- id: flake8
- repo: https://github.com/asottile/pyupgrade
rev: v2.7.4
rev: v3.21.2
hooks:
- id: pyupgrade
args: [--py36-plus]
24 changes: 5 additions & 19 deletions reg/tests/test_docgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ def rstrip_lines(s):
def test_dispatch_method_class_help(capsys):
pydoc.help(Foo)
out, err = capsys.readouterr()
assert (
rstrip_lines(out)
== """\
assert rstrip_lines(out) == """\
Help on class Foo in module reg.tests.fixtures.module:

class Foo({builtins}.object)
Expand All @@ -35,38 +33,29 @@ class Foo({builtins}.object)
|
| __weakref__
| list of weak references to the object (if defined)
""".format(
builtins=object.__module__
)
)
""".format(builtins=object.__module__)


def test_dispatch_method_help(capsys):
pydoc.help(Foo.bar)
out, err = capsys.readouterr()
assert (
rstrip_lines(out)
== """\
assert rstrip_lines(out) == """\
Help on function bar in module reg.tests.fixtures.module:

bar(self, obj)
Return the bar of an object.
"""
)


def test_dispatch_help(capsys):
pydoc.help(foo)
out, err = capsys.readouterr()
assert (
rstrip_lines(out)
== """\
assert rstrip_lines(out) == """\
Help on function foo in module reg.tests.fixtures.module:

foo(obj)
return the foo of an object.
"""
)


def test_autodoc(tmpdir):
Expand All @@ -80,9 +69,7 @@ def test_autodoc(tmpdir):
# remove it.
app = Sphinx(root, root, root + "/build", root, "text", status=None)
app.build()
assert (
tmpdir.join("build/contents.txt").read()
== """\
assert tmpdir.join("build/contents.txt").read() == """\
Sample module for testing autodoc.

class reg.tests.fixtures.module.Foo
Expand All @@ -101,4 +88,3 @@ class reg.tests.fixtures.module.Foo

return the foo of an object.
"""
)