Skip to content

Commit

Permalink
[3.11] pythongh-84461: Fix test_sqlite for Emscripten/WASI (pythonGH-…
Browse files Browse the repository at this point in the history
…94125).

(cherry picked from commit 15bfabd)

Co-authored-by: Christian Heimes <[email protected]>
  • Loading branch information
tiran committed Jun 23, 2022
1 parent 00a25f8 commit e43aead
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Lib/test/test_sqlite3/test_dbapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
import unittest
import urllib.parse

from test.support import SHORT_TIMEOUT, bigmemtest, check_disallow_instantiation
from test.support import (
SHORT_TIMEOUT, bigmemtest, 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
Expand Down Expand Up @@ -658,6 +661,7 @@ def test_open_with_path_like_object(self):

@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
Expand Down Expand Up @@ -703,6 +707,7 @@ def test_open_uri_readonly(self):

@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
Expand Down Expand Up @@ -1458,6 +1463,7 @@ def test_blob_closed_db_read(self):
blob.read)


@threading_helper.requires_working_threading()
class ThreadTests(unittest.TestCase):
def setUp(self):
self.con = sqlite.connect(":memory:")
Expand Down Expand Up @@ -1822,6 +1828,7 @@ def test_on_conflict_replace(self):
self.assertEqual(self.cu.fetchall(), [('Very different data!', 'foo')])


@requires_subprocess()
class MultiprocessTests(unittest.TestCase):
CONNECTION_TIMEOUT = SHORT_TIMEOUT / 1000. # Defaults to 30 ms

Expand Down

0 comments on commit e43aead

Please sign in to comment.