Skip to content

Minor bug in scenario without ssh tunnel #97

Description

@zlochina

The problem is that config variable always has attribute server, which means that db_server_port is always overwritten. I've encountered this issue when running pytest in main branch.
Suggestion:

  • replace line 61 with if hasattr(config, "server") and config.server is not None:

def setup_ssh_tunnel(config: CredentialsConfig) -> int:
"""Set up SSH tunnel if needed and returns port number."""
if hasattr(config, "server"): # remote connection
db.start_or_restart_ssh_connection_if_needed()
config.db_server_port = db.ssh_tunnel_local_port
return db.ssh_tunnel_local_port
# local connection
return config.db_server_port

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions