summaryrefslogtreecommitdiff
path: root/tests/misc/non_compliant.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-10-17 11:43:47 +1100
committerDamien George <damien.p.george@gmail.com>2016-10-17 11:43:47 +1100
commite9404e5f5f058db954ac0a92cb5acfcef6f6724a (patch)
tree6d5ced599e860604aea660de5fb5be1199d29963 /tests/misc/non_compliant.py
parent453c2e8f55132d92933f2de0308166730576ecc4 (diff)
tests: Improve coverage of array, range, dict, slice, exc, unicode.
Diffstat (limited to 'tests/misc/non_compliant.py')
-rw-r--r--tests/misc/non_compliant.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/misc/non_compliant.py b/tests/misc/non_compliant.py
index e0b07c3ad..677438b83 100644
--- a/tests/misc/non_compliant.py
+++ b/tests/misc/non_compliant.py
@@ -9,6 +9,12 @@ try:
except SyntaxError:
print('SyntaxError')
+# store to exception attribute is not allowed
+try:
+ ValueError().x = 0
+except AttributeError:
+ print('AttributeError')
+
# array deletion not implemented
try:
a = array.array('b', (1, 2, 3))
@@ -23,6 +29,12 @@ try:
except NotImplementedError:
print('NotImplementedError')
+# containment, looking for integer not implemented
+try:
+ print(1 in array.array('B', b'12'))
+except NotImplementedError:
+ print('NotImplementedError')
+
# should raise type error
try:
print(set('12') >= '1')
@@ -65,6 +77,12 @@ try:
except NotImplementedError:
print('NotImplementedError')
+# str subscr with step!=1 not implemented
+try:
+ print('abc'[1:2:3])
+except NotImplementedError:
+ print('NotImplementedError')
+
# bytes(...) with keywords not implemented
try:
bytes('abc', encoding='utf8')