Skip to content
Snippets Groups Projects
Commit ca39ea7c authored by Damien George's avatar Damien George
Browse files

tests: Skip tests needing machine module if (u)machine doesn't exist.

parent 70a28e3a
No related branches found
No related tags found
No related merge requests found
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
# For this test we need a native class that can be subclassed (has make_new) # For this test we need a native class that can be subclassed (has make_new)
# 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
......
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
......
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
......
# 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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment