diff options
| author | Christian Heimes <christian@python.org> | 2022-03-22 10:04:36 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-22 10:04:36 (GMT) |
| commit | deeaac49e267285158264643799624623f4a7b29 (patch) | |
| tree | 27f409d7d43cf169451aa892a2363f1cac85f7df /Lib/test/test_logging.py | |
| parent | a25a985535ccbb7df8caddc0017550ff4eae5855 (diff) | |
| download | cpython-deeaac49e267285158264643799624623f4a7b29.zip cpython-deeaac49e267285158264643799624623f4a7b29.tar.gz cpython-deeaac49e267285158264643799624623f4a7b29.tar.bz2 | |
bpo-40280: Skip socket, fork, subprocess tests on Emscripten (GH-31986)
- Add requires_fork and requires_subprocess to more tests
- Skip extension import tests if dlopen is not available
- Don't assume that _testcapi is a shared extension
- Skip a lot of socket tests that don't work on Emscripten
- Skip mmap tests, mmap emulation is incomplete
- venv does not work yet
- Cannot get libc from executable
The "entire" test suite is now passing on Emscripten with EMSDK from git head (91 suites are skipped).
Diffstat (limited to 'Lib/test/test_logging.py')
| -rw-r--r-- | Lib/test/test_logging.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index be193dc..5f72a6d 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -75,6 +75,7 @@ try: except ImportError: pass + class BaseTest(unittest.TestCase): """Base class for logging tests.""" @@ -626,6 +627,9 @@ class HandlerTest(BaseTest): os.unlink(fn) @unittest.skipIf(os.name == 'nt', 'WatchedFileHandler not appropriate for Windows.') + @unittest.skipIf( + support.is_emscripten, "Emscripten cannot fstat unlinked files." + ) def test_race(self): # Issue #14632 refers. def remove_loop(fname, tries): @@ -1058,6 +1062,7 @@ if hasattr(socket, "AF_UNIX"): # - end of server_helper section +@support.requires_working_socket() class SMTPHandlerTest(BaseTest): # bpo-14314, bpo-19665, bpo-34092: don't wait forever TIMEOUT = support.LONG_TIMEOUT @@ -1681,6 +1686,7 @@ class ConfigFileTest(BaseTest): os.unlink(fn) +@support.requires_working_socket() class SocketHandlerTest(BaseTest): """Test for SocketHandler objects.""" @@ -1795,6 +1801,7 @@ class UnixSocketHandlerTest(SocketHandlerTest): SocketHandlerTest.tearDown(self) os_helper.unlink(self.address) +@support.requires_working_socket() class DatagramHandlerTest(BaseTest): """Test for DatagramHandler.""" @@ -1876,6 +1883,7 @@ class UnixDatagramHandlerTest(DatagramHandlerTest): DatagramHandlerTest.tearDown(self) os_helper.unlink(self.address) +@support.requires_working_socket() class SysLogHandlerTest(BaseTest): """Test for SysLogHandler using UDP.""" @@ -1985,6 +1993,7 @@ class IPv6SysLogHandlerTest(SysLogHandlerTest): self.server_class.address_family = socket.AF_INET super(IPv6SysLogHandlerTest, self).tearDown() +@support.requires_working_socket() class HTTPHandlerTest(BaseTest): """Test for HTTPHandler.""" @@ -3261,6 +3270,7 @@ class ConfigDictTest(BaseTest): logging.config.stopListening() threading_helper.join_thread(t) + @support.requires_working_socket() def test_listen_config_10_ok(self): with support.captured_stdout() as output: self.setup_via_listener(json.dumps(self.config10)) @@ -3280,6 +3290,7 @@ class ConfigDictTest(BaseTest): ('ERROR', '4'), ], stream=output) + @support.requires_working_socket() def test_listen_config_1_ok(self): with support.captured_stdout() as output: self.setup_via_listener(textwrap.dedent(ConfigFileTest.config1)) @@ -3294,6 +3305,7 @@ class ConfigDictTest(BaseTest): # Original logger output is empty. self.assert_log_lines([]) + @support.requires_working_socket() def test_listen_verify(self): def verify_fail(stuff): |
