Skip to content

Do not always stop container on __del__ #146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andredasilvapinto opened this issue Jun 10, 2021 · 1 comment
Closed

Do not always stop container on __del__ #146

andredasilvapinto opened this issue Jun 10, 2021 · 1 comment

Comments

@andredasilvapinto
Copy link

andredasilvapinto commented Jun 10, 2021

A user of the library might, for examle, not keep the reference to DockerContainer but use get_wrapped_container to access the underlying Container object and keep that instead. Currently this will produce an unexpected container stop triggered by GC.

If you want to keep this behaviour it should at least be optional (configured by a constructor stop_on_deletion flag for example).

Relevant code: https://github.com/testcontainers/testcontainers-python/blob/master/testcontainers/core/container.py#L69-L77

@tillahoffmann
Copy link
Collaborator

Duplicate of #109. Let's discuss further there if needed.

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

No branches or pull requests

2 participants