avast / pytest-docker

Docker-based integration tests
MIT License
427 stars 71 forks source link

__init__() got an unexpected keyword argument 'tls' #45

Closed bendog closed 4 years ago

bendog commented 4 years ago

Just started getting the following exception when running on BitBucket pipelines. This was working yesterday.

I'm going to investigate further, however i thought i'd put this here for anyone else who was hitting the same issue.

E           Exception: Command docker-compose -f "/opt/atlassian/pipelines/agent/build/api/tests/docker-compose.yml" -p "pytest841" up --build -d returned 1: """Traceback (most recent call last):
E             File "/usr/local/bin/docker-compose", line 8, in <module>
E               sys.exit(main())
E             File "/usr/local/lib/python3.8/site-packages/compose/cli/main.py", line 72, in main
E               command()
E             File "/usr/local/lib/python3.8/site-packages/compose/cli/main.py", line 125, in perform_command
E               project = project_from_options('.', options)
E             File "/usr/local/lib/python3.8/site-packages/compose/cli/command.py", line 66, in project_from_options
E               return get_project(
E             File "/usr/local/lib/python3.8/site-packages/compose/cli/command.py", line 141, in get_project
E               client = get_client(
E             File "/usr/local/lib/python3.8/site-packages/compose/cli/docker_client.py", line 45, in get_client
E               client = docker_client(
E             File "/usr/local/lib/python3.8/site-packages/compose/cli/docker_client.py", line 141, in docker_client
E               context = Context("compose", host=host, tls=verify)
E           TypeError: __init__() got an unexpected keyword argument 'tls'
E           """.
/usr/local/lib/python3.8/site-packages/pytest_docker/plugin.py:24: Exception
bendog commented 4 years ago

https://github.com/docker/compose/issues/7505

Luminaar commented 4 years ago

Hello, Thank you for reporting this issue.

The workaround, for now, is to require docker==4.2.1 explicitly in you environment. I will merge #48 once docker-compose==1.26.1 (which includes specifies that requirement) is out.