tests/extmod: Skip select/socket tests if they can't create UDP socket.
Some targets (eg PYBV10) have the socket module but are unable to create UDP sockets without a registered NIC. So skip UDP tests on these targets. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
parent
6b78a1bf00
commit
218242d1de
@ -8,9 +8,13 @@ except (ImportError, AttributeError):
|
|||||||
print("SKIP")
|
print("SKIP")
|
||||||
raise SystemExit
|
raise SystemExit
|
||||||
|
|
||||||
|
try:
|
||||||
|
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||||
|
s.bind(socket.getaddrinfo("127.0.0.1", 8000)[0][-1])
|
||||||
|
except OSError:
|
||||||
|
print("SKIP")
|
||||||
|
raise SystemExit
|
||||||
|
|
||||||
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
|
||||||
s.bind(socket.getaddrinfo("127.0.0.1", 8000)[0][-1])
|
|
||||||
poll = select.poll()
|
poll = select.poll()
|
||||||
|
|
||||||
# UDP socket should not be readable
|
# UDP socket should not be readable
|
||||||
|
@ -6,9 +6,13 @@ except ImportError:
|
|||||||
print("SKIP")
|
print("SKIP")
|
||||||
raise SystemExit
|
raise SystemExit
|
||||||
|
|
||||||
|
try:
|
||||||
|
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||||
|
s.bind(socket.getaddrinfo("127.0.0.1", 8000)[0][-1])
|
||||||
|
except OSError:
|
||||||
|
print("SKIP")
|
||||||
|
raise SystemExit
|
||||||
|
|
||||||
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
|
||||||
s.bind(socket.getaddrinfo("127.0.0.1", 8000)[0][-1])
|
|
||||||
s.settimeout(0)
|
s.settimeout(0)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user