diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2020-03-22 15:04:59 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@bbpush.zzzcomputing.com> | 2020-03-22 15:04:59 +0000 |
| commit | 7ff3e3f2e73e7f17c0a352dacf5c0ccfa2ef7be9 (patch) | |
| tree | 553fd8f751a75dc5d614c32065817f8da6206968 /test/sql/test_quote.py | |
| parent | f2a817dd7cde50988839750b9c2464675fb4f069 (diff) | |
| parent | 9ec75882203b2c01aa1d362f939e21ebcd188e8d (diff) | |
| download | sqlalchemy-7ff3e3f2e73e7f17c0a352dacf5c0ccfa2ef7be9.tar.gz | |
Merge "Deprecate plain string in execute and introduce `exec_driver_sql`"
Diffstat (limited to 'test/sql/test_quote.py')
| -rw-r--r-- | test/sql/test_quote.py | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/test/sql/test_quote.py b/test/sql/test_quote.py index aba6a0204..627626994 100644 --- a/test/sql/test_quote.py +++ b/test/sql/test_quote.py @@ -90,19 +90,23 @@ class QuoteExecTest(fixtures.TestBase): @testing.provide_metadata def test_has_table_case_sensitive(self): preparer = testing.db.dialect.identifier_preparer - if testing.db.dialect.requires_name_normalize: - testing.db.execute("CREATE TABLE TAB1 (id INTEGER)") - else: - testing.db.execute("CREATE TABLE tab1 (id INTEGER)") - testing.db.execute( - "CREATE TABLE %s (id INTEGER)" % preparer.quote_identifier("tab2") - ) - testing.db.execute( - "CREATE TABLE %s (id INTEGER)" % preparer.quote_identifier("TAB3") - ) - testing.db.execute( - "CREATE TABLE %s (id INTEGER)" % preparer.quote_identifier("TAB4") - ) + with testing.db.connect() as conn: + if conn.dialect.requires_name_normalize: + conn.exec_driver_sql("CREATE TABLE TAB1 (id INTEGER)") + else: + conn.exec_driver_sql("CREATE TABLE tab1 (id INTEGER)") + conn.exec_driver_sql( + "CREATE TABLE %s (id INTEGER)" + % preparer.quote_identifier("tab2") + ) + conn.exec_driver_sql( + "CREATE TABLE %s (id INTEGER)" + % preparer.quote_identifier("TAB3") + ) + conn.exec_driver_sql( + "CREATE TABLE %s (id INTEGER)" + % preparer.quote_identifier("TAB4") + ) t1 = Table( "tab1", self.metadata, Column("id", Integer, primary_key=True) |
