Skip to content

object has no attribute '_container' in DockerContainer.__del__(self) #353

@jankatins

Description

@jankatins

Describe the bug

AFTER a pipeline run in azure dev ops (which had a failure for the dockerpy + requests/urllib3 incompatibility), I get the following errors:

======================= 14 passed, 131 errors in 24.94s ========================
Exception ignored in: <function DockerContainer.__del__ at 0x7f0d9990da20>
Traceback (most recent call last):
  File "/home/vsts/.cache/pypoetry/virtualenvs/mds-data-core-3AFF4dIC-py3.10/lib/python3.10/site-packages/testcontainers/core/container.py", line 86, in __del__
    if self._container is not None:
AttributeError: 'PostgresContainer' object has no attribute '_container'
Exception ignored in: <function DockerContainer.__del__ at 0x7f0d9990da20>
Traceback (most recent call last):
  File "/home/vsts/.cache/pypoetry/virtualenvs/mds-data-core-3AFF4dIC-py3.10/lib/python3.10/site-packages/testcontainers/core/container.py", line 86, in __del__
    if self._container is not None:
AttributeError: 'ConfluentKafkaContainer' object has no attribute '_container'

ConfluentKafkaContainer is my workaorund for #351

To me this looks like some parts of the class are already gone when the __del__ is called?

The following packages were installed during the run:

testcontainers-kafka = {version = "^0.0.1rc1"}
testcontainers-postgres = {version = "^0.0.1rc1"}
testcontainers-compose = {version = "^0.0.1rc1"}

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