Skip to content

Commit 7314eba

Browse files
committed
tests/misc/non_compliant: Add test for inability to assign func attrs.
1 parent fb58380 commit 7314eba

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

tests/misc/non_compliant.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,11 @@
124124
bytearray(4)[0:1] = [1, 2]
125125
except NotImplementedError:
126126
print('NotImplementedError')
127+
128+
# can't assign attributes to a function
129+
def f():
130+
pass
131+
try:
132+
f.x = 1
133+
except AttributeError:
134+
print('AttributeError')

tests/misc/non_compliant.py.exp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ NotImplementedError
1919
b'\x01\x02'
2020
b'\x01\x00'
2121
NotImplementedError
22+
AttributeError

0 commit comments

Comments
 (0)