Skip to content

Commit 013b359

Browse files
author
vshepard
committed
Add tunnel_port to remote_ops.py
1 parent 22d3251 commit 013b359

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

testgres/operations/remote_ops.py

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def __init__(self, conn_params: ConnectionParams):
5656
self.remote = True
5757
self.username = conn_params.username or self.get_user()
5858
self.tunnel_process = None
59+
self.tunnel_port = None
5960

6061
def __enter__(self):
6162
return self
@@ -408,6 +409,7 @@ def db_connect(self, dbname, user, password=None, host="localhost", port=5432):
408409
Establish SSH tunnel and connect to a PostgreSQL database.
409410
"""
410411
local_port = reserve_port()
412+
self.tunnel_port = local_port
411413
self.establish_ssh_tunnel(local_port=local_port, remote_port=port)
412414
try:
413415
conn = pglib.connect(

0 commit comments

Comments
 (0)