Skip to content

Do not always stop container on __del__ #146

Closed
@andredasilvapinto

Description

@andredasilvapinto

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions