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
A user of the library might, for examle, not keep the reference to
DockerContainerbut use get_wrapped_container to access the underlyingContainerobject 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_deletionflag for example).Relevant code: https://github.com/testcontainers/testcontainers-python/blob/master/testcontainers/core/container.py#L69-L77