summaryrefslogtreecommitdiffstatshomepage
path: root/tests/misc/non_compliant.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/misc/non_compliant.py')
-rw-r--r--tests/misc/non_compliant.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/misc/non_compliant.py b/tests/misc/non_compliant.py
index ba2dd15c6a..677438b832 100644
--- a/tests/misc/non_compliant.py
+++ b/tests/misc/non_compliant.py
@@ -1,6 +1,19 @@
# tests for things that are not implemented, or have non-compliant behaviour
import array
+import ustruct
+
+# when super can't find self
+try:
+ exec('def f(): super()')
+except SyntaxError:
+ print('SyntaxError')
+
+# store to exception attribute is not allowed
+try:
+ ValueError().x = 0
+except AttributeError:
+ print('AttributeError')
# array deletion not implemented
try:
@@ -16,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')
@@ -58,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')
@@ -87,3 +112,9 @@ try:
del [][2:3:4]
except NotImplementedError:
print('NotImplementedError')
+
+# struct pack with too many args, not checked by uPy
+print(ustruct.pack('bb', 1, 2, 3))
+
+# struct pack with too few args, not checked by uPy
+print(ustruct.pack('bb', 1))