We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c9bd3dc commit 0bc1909Copy full SHA for 0bc1909
autoclass/tests/features/test_autoclass.py
@@ -106,7 +106,7 @@ def test_autoclass_pyfields():
106
"""tests that @autoclass works with pyfields"""
107
from pyfields import field
108
109
- @autoclass
+ @autoclass(autodict=False)
110
class Foo(object):
111
foo1 = field()
112
foo2 = field(default=0)
@@ -127,3 +127,11 @@ class Bar(Foo):
127
128
# order in prints is the same than in init
129
assert str(a) == "Bar(foo1='th', foo2=0, bar=2)"
130
+
131
+ # test autorepr
132
+ f = Foo('a')
133
+ assert str(f) == "Foo(foo1='a', foo2=0)"
134
135
+ # autodict was really disabled
136
+ with pytest.raises(AttributeError):
137
+ f.items()
0 commit comments