Skip to content

Commit

Permalink
i
Browse files Browse the repository at this point in the history
  • Loading branch information
tlocke committed Jul 26, 2023
1 parent 74d9f89 commit 53198e6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions test/native/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ def test_internet_socket_connection_refused():
def test_Connection_plain_socket(db_kwargs):
host = db_kwargs.get("host", "localhost")
port = db_kwargs.get("port", 5432)
sock = socket.create_connection((host, port))
user = db_kwargs["user"]
conn_params = {"sock": sock, "user": user}
with socket.create_connection((host, port)) as sock:
user = db_kwargs["user"]
password = db_kwargs["password"]
conn_params = {"sock": sock, "user": user, "password": password}

con = Connection(**conn_params)
con = Connection(**conn_params)

res = con.run("SELECT 1")
assert res[0][0] == 1
res = con.run("SELECT 1")
assert res[0][0] == 1


def test_database_missing(db_kwargs):
Expand Down

0 comments on commit 53198e6

Please sign in to comment.