summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_httpservers.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_httpservers.py')
-rw-r--r--Lib/test/test_httpservers.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py
index 9fa6ecf..d762ec6 100644
--- a/Lib/test/test_httpservers.py
+++ b/Lib/test/test_httpservers.py
@@ -30,8 +30,9 @@ from io import BytesIO, StringIO
import unittest
from test import support
-from test.support import os_helper
-from test.support import threading_helper
+from test.support import (
+ is_apple, os_helper, requires_subprocess, threading_helper
+)
support.requires_working_socket(module=True)
@@ -410,8 +411,8 @@ class SimpleHTTPServerTestCase(BaseTestCase):
reader.close()
return body
- @unittest.skipIf(sys.platform == 'darwin',
- 'undecodable name cannot always be decoded on macOS')
+ @unittest.skipIf(is_apple,
+ 'undecodable name cannot always be decoded on Apple platforms')
@unittest.skipIf(sys.platform == 'win32',
'undecodable name cannot be decoded on win32')
@unittest.skipUnless(os_helper.TESTFN_UNDECODABLE,
@@ -422,11 +423,11 @@ class SimpleHTTPServerTestCase(BaseTestCase):
with open(os.path.join(self.tempdir, filename), 'wb') as f:
f.write(os_helper.TESTFN_UNDECODABLE)
response = self.request(self.base_url + '/')
- if sys.platform == 'darwin':
- # On Mac OS the HFS+ filesystem replaces bytes that aren't valid
- # UTF-8 into a percent-encoded value.
+ if is_apple:
+ # On Apple platforms the HFS+ filesystem replaces bytes that
+ # aren't valid UTF-8 into a percent-encoded value.
for name in os.listdir(self.tempdir):
- if name != 'test': # Ignore a filename created in setUp().
+ if name != 'test': # Ignore a filename created in setUp().
filename = name
break
body = self.check_status_and_reason(response, HTTPStatus.OK)
@@ -697,6 +698,7 @@ print("</pre>")
@unittest.skipIf(hasattr(os, 'geteuid') and os.geteuid() == 0,
"This test can't be run reliably as root (issue #13308).")
+@requires_subprocess()
class CGIHTTPServerTestCase(BaseTestCase):
class request_handler(NoLogRequestHandler, CGIHTTPRequestHandler):
_test_case_self = None # populated by each setUp() method call.