Skip to content

Commit

Permalink
Backport PR #61000: TST: Change sqlite test query string values to si…
Browse files Browse the repository at this point in the history
…ngle quotes
  • Loading branch information
mroeschke authored and meeseeksmachine committed Feb 24, 2025
1 parent 684a1a3 commit 2a8b0f8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pandas/tests/io/test_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -4255,11 +4255,11 @@ def test_xsqlite_execute_fail(sqlite_buildin):
cur.execute(create_sql)

with sql.pandasSQL_builder(sqlite_buildin) as pandas_sql:
pandas_sql.execute('INSERT INTO test VALUES("foo", "bar", 1.234)')
pandas_sql.execute('INSERT INTO test VALUES("foo", "baz", 2.567)')
pandas_sql.execute("INSERT INTO test VALUES('foo', 'bar', 1.234)")
pandas_sql.execute("INSERT INTO test VALUES('foo', 'baz', 2.567)")

with pytest.raises(sql.DatabaseError, match="Execution failed on sql"):
pandas_sql.execute('INSERT INTO test VALUES("foo", "bar", 7)')
pandas_sql.execute("INSERT INTO test VALUES('foo', 'bar', 7)")


def test_xsqlite_execute_closed_connection():
Expand All @@ -4277,7 +4277,7 @@ def test_xsqlite_execute_closed_connection():
cur.execute(create_sql)

with sql.pandasSQL_builder(conn) as pandas_sql:
pandas_sql.execute('INSERT INTO test VALUES("foo", "bar", 1.234)')
pandas_sql.execute("INSERT INTO test VALUES('foo', 'bar', 1.234)")

msg = "Cannot operate on a closed database."
with pytest.raises(sqlite3.ProgrammingError, match=msg):
Expand Down

0 comments on commit 2a8b0f8

Please sign in to comment.