Closed michaelbukachi closed 2 years ago
Thats a great thought, the CLI is simple enough where we could do something like:
import os
image = os.getenv("POSTGRES_IMAGE", "postgres:9.6.10-alpine")
and drop the replacement at https://github.com/schireson/pytest-mock-resources/blob/6f3c083d85c02892028e332897ad860b125c68ac/src/pytest_mock_resources/cli.py#L31
similarly we could do the above for https://github.com/schireson/pytest-mock-resources/blob/6f3c083d85c02892028e332897ad860b125c68ac/src/pytest_mock_resources/container/postgres.py#L31
to garner consistency.
@michaelbukachi are you up for PR'ing the change?
@oakhan3 On it :smiley:
@oakhan3 For the second case, don't we have the ability to override the image already by defining the pmr_postgres_config
?
Ideally (imo) it would pick up on pmr_postgres_config, but that likely requires at least some miminal set of assumptions about how pytest is invoked.
With that being said, i would prefer PMR_POSTGRES_IMAGE because that's the environment variable fallback that gets used by PMR proper already
It would be nice if we can specify the image version downloaded when running
pmr
. Currently, the image versions are hardcoded in the code. Maybe we can use an environment variable? :thinking: