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>
pull/12138/head
Damien George 2023-08-07 12:36:00 +10:00
rodzic 6b78a1bf00
commit 218242d1de
2 zmienionych plików z 12 dodań i 4 usunięć

Wyświetl plik

@ -8,9 +8,13 @@ except (ImportError, AttributeError):
print("SKIP")
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()
# UDP socket should not be readable

Wyświetl plik

@ -6,9 +6,13 @@ except ImportError:
print("SKIP")
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)
try: