tests/basics: Improve user class coverage.

This commit is contained in:
Rami Ali 2016-11-22 15:49:02 +11:00
parent 1b41cacac7
commit 2eff9c29a1
2 changed files with 18 additions and 0 deletions

View File

@ -15,3 +15,12 @@ c = C()
print(c[1]) print(c[1])
c[1] = 2 c[1] = 2
del c[3] del c[3]
# index not supported
class A:
pass
a = A()
try:
a[1]
except TypeError:
print('TypeError')

View File

@ -0,0 +1,9 @@
# converting user instance to buffer
class C:
pass
c = C()
try:
d = bytearray(c)
except TypeError:
print('TypeError')