Open ColeDCrawford opened 1 year ago
Any thoughts @Luminaar ?
Looks like the pytest-docker plugin is simply not being loaded. Only the docker_compose_file
shows in your error message because it is overridden in your conftest.py. If you run the pytest --fixtures [testpath]
you were suggested, you should see a section like
------------------------------------------------ fixtures defined from pytest_docker.plugin ------------------------------------------------
docker_compose_command [session scope] -- .venv/lib/python3.10/site-packages/pytest_docker/plugin.py:133
Docker Compose command to use, it could be either `docker-compose`
for Docker Compose v1 or `docker compose` for Docker Compose
v2.
docker_compose_file [session scope] -- .venv/lib/python3.10/site-packages/pytest_docker/plugin.py:142
Get an absolute path to the `docker-compose.yml` file. Override this
fixture in your tests if you need a custom location.
docker_compose_project_name [session scope] -- .venv/lib/python3.10/site-packages/pytest_docker/plugin.py:150
Generate a project name using the current process PID. Override this
fixture in your tests if you need a particular project name.
docker_cleanup [session scope] -- .venv/lib/python3.10/site-packages/pytest_docker/plugin.py:163
Get the docker_compose command to be executed for test clean-up actions.
Override this fixture in your tests if you need to change clean-up actions.
Returning anything that would evaluate to False will skip this command.
docker_setup [session scope] -- .venv/lib/python3.10/site-packages/pytest_docker/plugin.py:177
Get the docker_compose command to be executed for test setup actions.
Override this fixture in your tests if you need to change setup actions.
Returning anything that would evaluate to False will skip this command.
docker_services [session scope] -- .venv/lib/python3.10/site-packages/pytest_docker/plugin.py:211
Start all services from a docker compose file (`docker-compose up`).
After test are finished, shutdown all services (`docker-compose down`).
docker_ip [session scope] -- .venv/lib/python3.10/site-packages/pytest_docker/plugin.py:46
Determine the IP address for TCP connections to Docker containers.
If you don't: check your pytest configuration as some option might be disabling the plugin autoload.
I had this message when the Docker daemon was unavailable. There was a previous message in the exception stack that gave me the hint. Once the daemon was running, the pytest --fixtures [testpath]
command showed the previously missing fixtures and all was well running the tests.
Maybe this insight helps someone in the future? Does it help you @ColeDCrawford ??
I had a similar issue just now actually, and the solution was as simple, as I was stupid!
Make sure, if you are using a venv
, that you are using the pytest
from the venv
in which you installed pytest-docker
!
I had a similar issue just now actually, and the solution was as simple, as I was stupid!
Make sure, if you are using a
venv
, that you are using thepytest
from thevenv
in which you installedpytest-docker
!
I have same solution))
Hello,
I'm creating an
http_service
fixture like the one featured in the readme. When I use the fixture, I'm gettingfixture 'docker_ip' not found
.conftest.py
tests file
When I run
pytest -vv
I am getting:Current pip venv: