]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-84461: Fix test_sqlite for Emscripten/WASI (#94125)
authorChristian Heimes <christian@python.org>
Thu, 23 Jun 2022 06:31:55 +0000 (08:31 +0200)
committerGitHub <noreply@github.com>
Thu, 23 Jun 2022 06:31:55 +0000 (08:31 +0200)
Lib/test/test_sqlite3/test_dbapi.py

index 18e84e9e58632b56d79dc8fc46d918905118d588..363a308f3e5feca780adea083f1108ffcd519413 100644 (file)
@@ -29,7 +29,10 @@ import threading
 import unittest
 import urllib.parse
 
-from test.support import SHORT_TIMEOUT, check_disallow_instantiation
+from test.support import (
+    SHORT_TIMEOUT, check_disallow_instantiation, requires_subprocess,
+    is_emscripten, is_wasi
+)
 from test.support import threading_helper
 from _testcapi import INT_MAX, ULLONG_MAX
 from os import SEEK_SET, SEEK_CUR, SEEK_END
@@ -653,6 +656,7 @@ class OpenTests(unittest.TestCase):
 
     @unittest.skipIf(sys.platform == "win32", "skipped on Windows")
     @unittest.skipIf(sys.platform == "darwin", "skipped on macOS")
+    @unittest.skipIf(is_emscripten or is_wasi, "not supported on Emscripten/WASI")
     @unittest.skipUnless(TESTFN_UNDECODABLE, "only works if there are undecodable paths")
     def test_open_with_undecodable_path(self):
         path = TESTFN_UNDECODABLE
@@ -698,6 +702,7 @@ class OpenTests(unittest.TestCase):
 
     @unittest.skipIf(sys.platform == "win32", "skipped on Windows")
     @unittest.skipIf(sys.platform == "darwin", "skipped on macOS")
+    @unittest.skipIf(is_emscripten or is_wasi, "not supported on Emscripten/WASI")
     @unittest.skipUnless(TESTFN_UNDECODABLE, "only works if there are undecodable paths")
     def test_open_undecodable_uri(self):
         path = TESTFN_UNDECODABLE
@@ -1453,6 +1458,7 @@ class BlobTests(unittest.TestCase):
                                    blob.read)
 
 
+@threading_helper.requires_working_threading()
 class ThreadTests(unittest.TestCase):
     def setUp(self):
         self.con = sqlite.connect(":memory:")
@@ -1817,6 +1823,7 @@ class SqliteOnConflictTests(unittest.TestCase):
         self.assertEqual(self.cu.fetchall(), [('Very different data!', 'foo')])
 
 
+@requires_subprocess()
 class MultiprocessTests(unittest.TestCase):
     CONNECTION_TIMEOUT = SHORT_TIMEOUT / 1000.  # Defaults to 30 ms