tests: Fixup tests for 3.x on Rosie

This commit is contained in:
Scott Shawcroft 2017-11-16 10:33:48 -08:00
parent ecc47d5258
commit 99153569f4
3 changed files with 18 additions and 0 deletions

View File

@ -1,3 +1,6 @@
import skip_if
skip_if.no_reverse_ops()
class A: class A:
def __init__(self, v): def __init__(self, v):

View File

@ -1,4 +1,6 @@
import skip_if import skip_if
# TODO(tannewt): Remove this when we add nvm support to 3.x
skip_if.always()
skip_if.board_not_in("metro_m0_express", "feather_m0_express", "circuitplayground_express") skip_if.board_not_in("metro_m0_express", "feather_m0_express", "circuitplayground_express")
import microcontroller import microcontroller

View File

@ -27,6 +27,9 @@ def skip():
print("SKIP") print("SKIP")
raise SystemExit raise SystemExit
def always():
skip()
def no_reversed(): def no_reversed():
import builtins import builtins
if "reversed" not in dir(builtins): if "reversed" not in dir(builtins):
@ -89,3 +92,13 @@ def no_slice_assign():
m2[1:3] = m1[0:2] m2[1:3] = m1[0:2]
except TypeError: except TypeError:
skip() skip()
def no_reverse_ops():
class Foo:
def __radd__(self, other):
pass
try:
5 + Foo()
except TypeError:
skip()