summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_urllib.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2022-05-23 08:39:57 (GMT)
committerGitHub <noreply@github.com>2022-05-23 08:39:57 (GMT)
commit760ec8940aabd6a7fc471bd913ea1ac501cc604b (patch)
treeee95f9ffb3214de69ea0e220c577a05c65d1e4e0 /Lib/test/test_urllib.py
parent88f0d0c1e8fdda036f3f64b0048911ba28ce7f06 (diff)
downloadcpython-760ec8940aabd6a7fc471bd913ea1ac501cc604b.zip
cpython-760ec8940aabd6a7fc471bd913ea1ac501cc604b.tar.gz
cpython-760ec8940aabd6a7fc471bd913ea1ac501cc604b.tar.bz2
gh-90473: WASI: skip gethostname tests (GH-93092)
- WASI's ``gethostname()`` is a stub that always fails with OSError ``ENOTSUP`` - skip mailcap ``test`` if subprocess is not available - WASI process_time clock does not work.
Diffstat (limited to 'Lib/test/test_urllib.py')
-rw-r--r--Lib/test/test_urllib.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_urllib.py b/Lib/test/test_urllib.py
index bc6e74c..f067560 100644
--- a/Lib/test/test_urllib.py
+++ b/Lib/test/test_urllib.py
@@ -10,6 +10,7 @@ import unittest
from unittest.mock import patch
from test import support
from test.support import os_helper
+from test.support import socket_helper
from test.support import warnings_helper
import os
try:
@@ -24,6 +25,10 @@ from base64 import b64encode
import collections
+if not socket_helper.has_gethostname:
+ raise unittest.SkipTest("test requires gethostname()")
+
+
def hexescape(char):
"""Escape char as RFC 2396 specifies"""
hex_repr = hex(ord(char))[2:].upper()