Skip to content

Commit 60e8adf

Browse files
committed
Add test for docstrings
1 parent 7903f4f commit 60e8adf

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/test_device_manager.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,3 +644,18 @@ def test_lazy_fixtures_contains():
644644
assert "foo" in lf
645645
assert "fizz" in lf
646646
assert "two" not in lf
647+
648+
649+
def test_docstrings_are_kept(dm: DeviceManager):
650+
@dm.factory
651+
def foo():
652+
"""This is the docstring for foo"""
653+
return Mock()
654+
655+
@dm.v1_init(Mock(), prefix="MOCK_PREFIX")
656+
def bar(_):
657+
"""This is the docstring for bar"""
658+
pass
659+
660+
assert foo.__doc__ == "This is the docstring for foo"
661+
assert bar.__doc__ == "This is the docstring for bar"

0 commit comments

Comments
 (0)