Skip to content

Commit 22161ac

Browse files
committed
tests/basics/class_super.py: Add tests for store/delete of super attr.
1 parent 7b7bbd0 commit 22161ac

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

tests/basics/class_super.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,14 @@ def foo(self):
3434
print(super().bar) # accessing attribute after super()
3535
return super().foo().count(2) # calling a subsequent method
3636
print(B().foo())
37+
38+
# store/delete of super attribute not allowed
39+
assert hasattr(super(B, B()), 'foo')
40+
try:
41+
super(B, B()).foo = 1
42+
except AttributeError:
43+
print('AttributeError')
44+
try:
45+
del super(B, B()).foo
46+
except AttributeError:
47+
print('AttributeError')

0 commit comments

Comments
 (0)