Skip to content

Commit 8949a91

Browse files
author
Scott Sanderson
committed
TEST: Add test for generated attributes.
1 parent 2b91526 commit 8949a91

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

interface/tests/test_interface.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,27 @@ class NotAnInterface:
145145

146146
with pytest.raises(TypeError):
147147
implements(NotAnInterface)
148+
149+
150+
def test_generated_attributes():
151+
152+
class IFace(Interface): # pragma: nocover
153+
def method(self, a, b):
154+
pass
155+
156+
def method2(self, a, b, c):
157+
pass
158+
159+
impl = implements(IFace)
160+
assert impl.__name__ == "ImplementsIFace"
161+
162+
expected_doc = dedent(
163+
"""\
164+
Implementation of IFace.
165+
166+
Methods
167+
-------
168+
method(self, a, b)
169+
method2(self, a, b, c)"""
170+
)
171+
assert impl.__doc__ == expected_doc

0 commit comments

Comments
 (0)