lister.pytest_plugin: Simplify fixture setup

This commit is contained in:
Antoine R. Dumont (@ardumont) 2020-10-21 17:46:52 +02:00
parent d7d38090f5
commit a19cb5fb51
No known key found for this signature in database
GPG key ID: 52E2E9840D10C3B8

View file

@ -17,13 +17,9 @@ logger = logging.getLogger(__name__)
@pytest.fixture
def lister_db_url(postgresql_proc, postgresql):
db_url = "postgresql://{user}@{host}:{port}/{dbname}".format(
host=postgresql_proc.host,
port=postgresql_proc.port,
user="postgres",
dbname="tests",
)
def lister_db_url(postgresql):
db_params = postgresql.get_dsn_parameters()
db_url = "postgresql://{user}@{host}:{port}/{dbname}".format(**db_params)
logger.debug("lister db_url: %s", db_url)
return db_url