Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion asyncpg/connect_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ def _parse_connect_dsn_and_args(*, dsn, host, port, user,
host = ['/run/postgresql', '/var/run/postgresql',
'/tmp', '/private/tmp', 'localhost']

if not isinstance(host, list):
if not isinstance(host, (list, tuple)):
host = [host]

if auth_hosts is None:
Expand Down
13 changes: 13 additions & 0 deletions tests/test_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,19 @@ class TestConnectParams(tb.TestCase):
'target_session_attrs': 'any',
})
},
{
'name': 'params_multi_host_dsn_env_mix_tuple',
'env': {
'PGUSER': 'foo',
},
'dsn': 'postgresql:///db',
'host': ('host1', 'host2'),
'result': ([('host1', 5432), ('host2', 5432)], {
'database': 'db',
'user': 'foo',
'target_session_attrs': 'any',
})
},

{
'name': 'params_combine_dsn_settings_override_and_ssl',
Expand Down