tests: Skip tests needing machine module if (u)machine doesn't exist.
This commit is contained in:
parent
70a28e3ad9
commit
ca39ea7cef
@ -4,13 +4,13 @@
|
|||||||
# and is callable (has call). The only one available is machine.Signal, which
|
# and is callable (has call). The only one available is machine.Signal, which
|
||||||
# in turns needs PinBase.
|
# in turns needs PinBase.
|
||||||
try:
|
try:
|
||||||
|
try:
|
||||||
import umachine as machine
|
import umachine as machine
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import machine
|
import machine
|
||||||
try:
|
|
||||||
machine.PinBase
|
machine.PinBase
|
||||||
machine.Signal
|
machine.Signal
|
||||||
except AttributeError:
|
except:
|
||||||
print("SKIP")
|
print("SKIP")
|
||||||
raise SystemExit
|
raise SystemExit
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
try:
|
try:
|
||||||
|
try:
|
||||||
import umachine as machine
|
import umachine as machine
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import machine
|
import machine
|
||||||
try:
|
|
||||||
machine.PinBase
|
machine.PinBase
|
||||||
except AttributeError:
|
except:
|
||||||
print("SKIP")
|
print("SKIP")
|
||||||
raise SystemExit
|
raise SystemExit
|
||||||
|
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
try:
|
try:
|
||||||
|
try:
|
||||||
import umachine as machine
|
import umachine as machine
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import machine
|
import machine
|
||||||
try:
|
|
||||||
machine.PinBase
|
machine.PinBase
|
||||||
machine.time_pulse_us
|
machine.time_pulse_us
|
||||||
except AttributeError:
|
except:
|
||||||
print("SKIP")
|
print("SKIP")
|
||||||
raise SystemExit
|
raise SystemExit
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
# test machine.Signal class
|
# test machine.Signal class
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
try:
|
||||||
import umachine as machine
|
import umachine as machine
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import machine
|
import machine
|
||||||
try:
|
|
||||||
machine.PinBase
|
machine.PinBase
|
||||||
machine.Signal
|
machine.Signal
|
||||||
except AttributeError:
|
except:
|
||||||
print("SKIP")
|
print("SKIP")
|
||||||
raise SystemExit
|
raise SystemExit
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user