Repository: pytest-docker-compose/pytest-docker-compose (language: python)

Issue:
Use list for compose_files instead of map
Was trying out pytest-docker-compose, have to have a custom path for my docker-compose file in my use case, and it didn't seem like the path I gave was actually getting used. It seems it has to do with how the `compose_files` variable is handled.

`compose_files` holds the list of docker-compose file paths gets transformed into a map of strings prior to passing it to `project_from_options()`. However, `project_from_options()` ends up accessing the iterator twice, which results in an empty list on the second read due to the variable being a map:

```
def project_from_options(project_dir, options, additional_options=None):
    override_dir = get_project_dir(options) ### Runs get_config_path_from_options under the hood
    return get_project(
        project_dir,
        get_config_path_from_options(options, environment) ### This arg will always be [] instead of the `compose_files` values
```


Discussion / hints:
LGTM w/ suggestion.  @RmStorm your thoughts?
@secretions Thank you for the PR, good catch! I agree with @todofixthis that this looks good. However I would really like a test to prevent a future regression! If you add a test I will merge the PR. Otherwise I will try to find the time on Monday to add a test and then merge it.
@RmStorm I added a test in the vein of the exiting multiple compose files test for a single compose file, validating it triggers the bug with the old code and doesn't with the new.
> @RmStorm I added a test in the vein of the exiting multiple compose files test for a single compose file, validating it triggers the bug with the old code and doesn't with the new.

Hey, I'm sorry for the trouble. I realise now that the extra test is unnecessary. This is an issue with docker-compose 1.28 that didn't exist in 1.27. When I upgrade to docker-compose 1.28 all the tests break so I will remove your new one since there is no risk of regression either way with the current tests.

I think the docker-compose people might not yet be aware of this subtle bug and they would also appreciate a PR if you have time.

Fix patch:
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 4d0b22c..d4137a0 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -34,7 +34,7 @@ jobs:
             tox
   publish:
     docker:
-      - image: circleci/python:3.8.0b1
+      - image: circleci/python:3.9.1
     working_directory: ~/repo
     steps:
       - checkout
diff --git a/requirements.txt b/requirements.txt
index 948c6be..6591472 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
-tox==3.20.0
-pytest==6.0.1
-docker-compose==1.27.0
+tox==3.21.2
+pytest==6.2.1
+docker-compose==1.28.0
diff --git a/setup.py b/setup.py
index 79594e5..6dbec27 100644
--- a/setup.py
+++ b/setup.py
@@ -7,7 +7,7 @@
     name="pytest-docker-compose",
     description="Manages Docker containers during your integration tests",
     long_description=long_description,
-    version="3.2.0",
+    version="3.2.1",
     author="Roald Storm",
     author_email="roaldstorm@gmail.com",
     url="https://github.com/pytest-docker-compose/pytest-docker-compose",
diff --git a/tox.ini b/tox.ini
index d5e115f..79d0997 100644
--- a/tox.ini
+++ b/tox.ini
@@ -7,7 +7,7 @@ deps =
     pytest4: pytest>=4,<5
     pytest5: pytest>=5,<6
     pytest6: pytest>=6,<7
-    docker-compose==1.26.2
+    docker-compose==1.28
     pycodestyle
     mypy
 whitelist_externals=


Test patch:
diff --git a/tests/pytest_docker_compose_tests/test_single_compose_file.py b/tests/pytest_docker_compose_tests/test_single_compose_file.py
deleted file mode 100644
index 8ffc342..0000000
--- a/tests/pytest_docker_compose_tests/test_single_compose_file.py
+++ /dev/null
@@ -1,44 +0,0 @@
-import time
-import requests
-from urllib.parse import urljoin
-from urllib3.util.retry import Retry
-from requests.adapters import HTTPAdapter
-
-import pytest
-
-pytest_plugins = ["docker_compose"]
-
-
-@pytest.fixture(scope="module")
-def wait_for_api(module_scoped_container_getter):
-    """Wait for the api from my_api_service to become responsive"""
-    request_session = requests.Session()
-    retries = Retry(total=5,
-                    backoff_factor=0.1,
-                    status_forcelist=[500, 502, 503, 504])
-    request_session.mount('http://', HTTPAdapter(max_retries=retries))
-
-    service = module_scoped_container_getter.get("my_api_service").network_info[0]
-    api_url = "http://%s:%s/" % (service.hostname, service.host_port)
-    assert request_session.get(api_url)
-
-    start = time.time()
-    while 'Exit' not in module_scoped_container_getter.get("my_short_lived_service").human_readable_state:
-        if time.time() - start >= 5:
-            raise RuntimeError(
-                'my_short_lived_service should spin up, echo "Echoing" and '
-                'then shut down, since it still running something went wrong'
-            )
-        time.sleep(.5)
-
-    return request_session, api_url
-
-
-@pytest.mark.compose_file_path
-def test_read_all(wait_for_api):
-    request_session, api_url = wait_for_api
-    assert len(request_session.get(urljoin(api_url, 'items/all')).json()) == 0
-
-
-if __name__ == '__main__':
-    pytest.main(['-m', 'compose_file_path', '--docker-compose', './my_network/docker-compose.yml', '--docker-compose-no-build'])