Closed vschmidt94 closed 4 years ago
Use case here:
By providing the user the option to customize the clean-up via a test fixture, this will allow user to use their own strategies as needed.
@Luminaar - will do, but expect a ~ 1 week delay. I need to follow internal policy and get approval before this goes in, since it was developed 'on company time'.
Sorry to jump in here, I found this PR looking for the exact same feature. I think this should be configurable with a pytest option so that the user can choose whether or not to reuse containers (e.g. CI vs local execution).
See how pytest-docker-compose
(which seems less active now though) is doing this for a complete solution:
docs: https://github.com/pytest-docker-compose/pytest-docker-compose/#use-wider-scoped-fixtures
code https://github.com/pytest-docker-compose/pytest-docker-compose/blob/develop/src/pytest_docker_compose/__init__.py#L124
But I'd be happy to open a separate PR for this later if you think it's out of scope.
@nejch, I think the --use-running-containers type flag is a good addition as well, but probably deserves its own PR, at least IMO. I may take a swing at that as well once I get cleared on this one.
Ok, no worries I'll follow this and open a separate PR later if needed, thanks! :)
@Luminaar - Apologies for taking so long to fix up, but ran into issues getting official approval due to key people out of office and needing their approval.
@nejch I feel that both this PR and what you propose are valuable features. I will gladly accept a PR if you drafted one
Allows user to override fixture to provide alternate clean-up command for docker_compose.