We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 37110cf commit bc45f47Copy full SHA for bc45f47
nibabel/tests/test_onetime.py
@@ -17,3 +17,17 @@ def a(self):
17
assert 'a' in x.__dict__
18
# Each call to object() produces a unique object. Verify we get the same one every time.
19
assert x.a is obj
20
+
21
22
+def test_auto_attr():
23
+ class MagicProp:
24
+ @auto_attr
25
+ def a(self):
26
+ return object()
27
28
+ x = MagicProp()
29
+ assert 'a' not in x.__dict__
30
+ obj = x.a
31
+ assert 'a' in x.__dict__
32
+ # Each call to object() produces a unique object. Verify we get the same one every time.
33
+ assert x.a is obj
0 commit comments