summaryrefslogtreecommitdiff
path: root/test/dialect/postgresql
diff options
context:
space:
mode:
authorGord Thompson <gord@gordthompson.com>2021-11-08 11:03:54 -0700
committerGord Thompson <gord@gordthompson.com>2021-11-09 06:12:39 -0700
commitbd1be0b7e0ecd76bdf6d26fd11cc42e1a473b319 (patch)
treebcb527a334bb3da906b8c450f93f3dc3ed683a27 /test/dialect/postgresql
parentcf404d840c15fe167518dd884b295dc99ee26178 (diff)
downloadsqlalchemy-bd1be0b7e0ecd76bdf6d26fd11cc42e1a473b319.tar.gz
De-emphasize notion of "default driver" (DBAPI)
Fixes: #6960 Even though a default driver still exists for each dialect, remove most usages of `dialect://` to encourage users to explicitly specify `dialect+driver://` Change-Id: I0ad42167582df509138fca64996bbb53e379b1af
Diffstat (limited to 'test/dialect/postgresql')
-rw-r--r--test/dialect/postgresql/test_dialect.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/test/dialect/postgresql/test_dialect.py b/test/dialect/postgresql/test_dialect.py
index e7c4ebb7c..fe3700bbb 100644
--- a/test/dialect/postgresql/test_dialect.py
+++ b/test/dialect/postgresql/test_dialect.py
@@ -171,42 +171,44 @@ $$ LANGUAGE plpgsql;"""
def test_psycopg2_empty_connection_string(self):
dialect = psycopg2_dialect.dialect()
- u = url.make_url("postgresql://")
+ u = url.make_url("postgresql+psycopg2://")
cargs, cparams = dialect.create_connect_args(u)
eq_(cargs, [""])
eq_(cparams, {})
def test_psycopg2_nonempty_connection_string(self):
dialect = psycopg2_dialect.dialect()
- u = url.make_url("postgresql://host")
+ u = url.make_url("postgresql+psycopg2://host")
cargs, cparams = dialect.create_connect_args(u)
eq_(cargs, [])
eq_(cparams, {"host": "host"})
def test_psycopg2_empty_connection_string_w_query_one(self):
dialect = psycopg2_dialect.dialect()
- u = url.make_url("postgresql:///?service=swh-log")
+ u = url.make_url("postgresql+psycopg2:///?service=swh-log")
cargs, cparams = dialect.create_connect_args(u)
eq_(cargs, [])
eq_(cparams, {"service": "swh-log"})
def test_psycopg2_empty_connection_string_w_query_two(self):
dialect = psycopg2_dialect.dialect()
- u = url.make_url("postgresql:///?any_random_thing=yes")
+ u = url.make_url("postgresql+psycopg2:///?any_random_thing=yes")
cargs, cparams = dialect.create_connect_args(u)
eq_(cargs, [])
eq_(cparams, {"any_random_thing": "yes"})
def test_psycopg2_nonempty_connection_string_w_query(self):
dialect = psycopg2_dialect.dialect()
- u = url.make_url("postgresql://somehost/?any_random_thing=yes")
+ u = url.make_url(
+ "postgresql+psycopg2://somehost/?any_random_thing=yes"
+ )
cargs, cparams = dialect.create_connect_args(u)
eq_(cargs, [])
eq_(cparams, {"host": "somehost", "any_random_thing": "yes"})
def test_psycopg2_nonempty_connection_string_w_query_two(self):
dialect = psycopg2_dialect.dialect()
- url_string = "postgresql://USER:PASS@/DB?host=hostA"
+ url_string = "postgresql+psycopg2://USER:PASS@/DB?host=hostA"
u = url.make_url(url_string)
cargs, cparams = dialect.create_connect_args(u)
eq_(cargs, [])
@@ -215,7 +217,7 @@ $$ LANGUAGE plpgsql;"""
def test_psycopg2_nonempty_connection_string_w_query_three(self):
dialect = psycopg2_dialect.dialect()
url_string = (
- "postgresql://USER:PASS@/DB"
+ "postgresql+psycopg2://USER:PASS@/DB"
"?host=hostA:portA&host=hostB&host=hostC"
)
u = url.make_url(url_string)