mirror of
https://github.com/python/cpython.git
synced 2025-07-23 11:15:24 +00:00
bpo-42264: Deprecate sqlite3.OptimizedUnicode (GH-23163)
This commit is contained in:
parent
296a796951
commit
a1f401a58b
5 changed files with 26 additions and 12 deletions
|
@ -254,9 +254,10 @@ class TextFactoryTests(unittest.TestCase):
|
|||
self.assertTrue(row[0].endswith("reich"), "column must contain original data")
|
||||
|
||||
def CheckOptimizedUnicode(self):
|
||||
# In py3k, str objects are always returned when text_factory
|
||||
# is OptimizedUnicode
|
||||
self.con.text_factory = sqlite.OptimizedUnicode
|
||||
# OptimizedUnicode is deprecated as of Python 3.10
|
||||
with self.assertWarns(DeprecationWarning) as cm:
|
||||
self.con.text_factory = sqlite.OptimizedUnicode
|
||||
self.assertIn("factory.py", cm.filename)
|
||||
austria = "Österreich"
|
||||
germany = "Deutchland"
|
||||
a_row = self.con.execute("select ?", (austria,)).fetchone()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue