testcontainers / testcontainers-python

Testcontainers is a Python library that providing a friendly API to run Docker container. It is designed to create runtime environment to use during your automatic tests.
https://testcontainers-python.readthedocs.io/en/latest/
Apache License 2.0
1.43k stars 270 forks source link

Bug: DockerCompose.client_args not working #596

Open dankirkham opened 1 month ago

dankirkham commented 1 month ago

Describe the bug

I was trying to pass client_args to the DockerCompose constructor. However, I get the error:

Traceback (most recent call last):
  File <removed>, in <module>
    test_foo()
  File <removed>, in test_foo
    compose = DockerCompose(
              ^^^^^^^^^^^^^^
TypeError: DockerCompose.__init__() got an unexpected keyword argument 'client_args'

I presume this is because it is in the doc string, but not the actual class definition.

To Reproduce

from testcontainers.compose import DockerCompose

compose = DockerCompose(
    client_args=True,
)

Runtime environment

testcontainers-python is 4.5.1 on Debian Docker version 26.1.3-1, build b72abbb6f0351eb22e5c7bdbba9112fef6b41429 Docker Compose version v2.27.1

alexanderankin commented 1 month ago

thats correct, it just calls subprocess.run to execute "docker compose" commands, so there is no meaning for client_args