Hacker News new | ask | show | jobs
by nickjj 433 days ago
What happens if your test produces a bunch of stdout, such as using `print(...)` somewhere? Where would it be displayed?

A couple of questions about Docker based on the README:

> enabled = true, -- Enable docker support

What does this do in the end? Is it starting containers or adjusting which test command gets run by prefixing a Docker command?

If so is there a way to opt out of that to have it still use Docker commands without it managing container lifecycles?

> docker_path = '/usr/src/app', -- This is the default path, if you use docker compose this is obtained from the docker compose file

How is this being read from that file? Are you reading a volume?

Is this meant to be what the WORKDIR is set to?

> docker_path_prefix = 'app', -- This is the prefix for the path in the cwd in your local, for example: root/app/<docker_app_content>

Is this meant to be what the WORKDIR is set to or what the COMPOSE_PROJECT would be set to?

> container = 'app-1', -- Container where the tests will be run

Will this be ignored in favor of the compose service name if compose is set to true?

> docker_compose_file = 'docker-compose.yml', -- This is the default docker compose file name

The default name has been compose.yaml for a long time now btw, you may want to support both out of the box.

> enable_docker_compose = true, -- Enable docker compose support

What does this do vs not having it enabled?

1 comments

Thanks for the feedback! I’ll update the README to clarify these points.

You can view the full Pytest output using the :PytestOutput command. This shows all outputs from failing tests (since Pytest doesn’t display output for passing tests by default). I also plan to implement support for custom arguments — for example, Pytest's -s flag to show stdout even when tests pass.

If Docker is disabled, all Docker-related features are also disabled. When Docker Compose is enabled, its configuration takes precedence over the plugin’s direct settings.

The prefix_app setting maps your local directory to the Docker path. For example, if your current working directory is ~/projects/, and the prefix is app, the Docker path /usr/src/app will map to ~/projects/app.

Docker is responsible only for path mapping and executing the Pytest command inside a running container — the container must already be running.

If you're using Docker Compose, the plugin retrieves the Docker path from the volume configuration. For example, if your docker-compose.yml contains:

volumes: - app:/usr/src/app

Then /usr/src/app will be used as the Docker path. If enable_docker_compose is set to false, the plugin will fall back to the manually configured path instead. (Note: the container itself is not retrieved from Docker Compose at this point.)