Skip to content

DatabaseJanitor ignores password #294

@strfx

Description

@strfx

Hi all

Just stumpled upon something. A PostgreSQL instance runs in a Docker container. The instance requires password. But when using the postgresql_noproc factory with a password supplied as factory parameter, it results in a psycopg2.OperationalError: fe_sendauth: no password supplied

The problems seems to be that the password parameter is not actually passed to DatabaseJanitor inside the factory: https://github.com/ClearcodeHQ/pytest-postgresql/blob/f7570d7b963295503d159c5081b87b7ae08f2c4d/src/pytest_postgresql/factories.py#L282-L284

Altough DatabaseJanitor passes the password parameter to psycopg2 when used as a context manager:
https://github.com/ClearcodeHQ/pytest-postgresql/blob/f7570d7b963295503d159c5081b87b7ae08f2c4d/src/pytest_postgresql/janitor.py#L79-L88

password is set to None by default:
https://github.com/ClearcodeHQ/pytest-postgresql/blob/f7570d7b963295503d159c5081b87b7ae08f2c4d/src/pytest_postgresql/janitor.py#L23-L34

Let me know if that is indeed a bug or if I can provide further details.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions