Skip to content

Commit 25c6fc7

Browse files
committed
tests/basics: Add test for builtin "delattr".
1 parent 5076e5c commit 25c6fc7

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

tests/basics/builtin_delattr.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# test builtin delattr
2+
3+
class A: pass
4+
a = A()
5+
a.x = 1
6+
print(a.x)
7+
8+
delattr(a, 'x')
9+
10+
try:
11+
a.x
12+
except AttributeError:
13+
print('AttributeError')
14+
15+
try:
16+
delattr(a, 'x')
17+
except AttributeError:
18+
print('AttributeError')

0 commit comments

Comments
 (0)