X Tutup
Skip to content

docs(testing): improve tox test execution and document workflow#3367

Open
amimas wants to merge 3 commits intopython-gitlab:mainfrom
amimas:test-config-enhancement
Open

docs(testing): improve tox test execution and document workflow#3367
amimas wants to merge 3 commits intopython-gitlab:mainfrom
amimas:test-config-enhancement

Conversation

@amimas
Copy link
Contributor

@amimas amimas commented Mar 10, 2026

Changes

This improves the developer experience by making the testing workflow more discoverable and flexible.

  • Updates tox.ini to use posargs with default values for the test environments. This allows developers to run the full test suite by default, or easily specify a single test file to run.

  • Adds description fields to the unit and functional test environments in tox.ini. This makes instructions on how to run specific tests visible in the output of tox list.

  • Updates CONTRIBUTING.rst with concrete examples for running specific unit, API functional, and CLI functional tests, aligning the documentation with the new tox configuration.

Documentation and testing

Please consider whether this PR needs documentation and tests. This is not required, but highly appreciated:

amimas added 3 commits March 9, 2026 23:52
This improves the developer experience by making the testing workflow
more discoverable and flexible.

- Updates `tox.ini` to use `posargs` with default values for the test
  environments. This allows developers to run the full test suite by
  default, or easily specify a single test file to run.

- Adds `description` fields to the unit and functional test
  environments in `tox.ini`. This makes instructions on how to run
  specific tests visible in the output of `tox list`.

- Updates `CONTRIBUTING.rst` with concrete examples for running
  specific unit, API functional, and CLI functional tests, aligning the
  documentation with the new `tox` configuration.
The `cover` environment was failing in CI with a "No such file or
directory: 'pytest'" error.

This occurred because the environment did not have a `deps` section to
install the testing requirements. While this might work locally due to
`tox` reusing environments, it fails in a clean CI run.

This change adds the required dependencies to the `[testenv:cover]`
section, ensuring it is self-contained and runs reliably.
The functional test environments (`cli_func_v4`, `api_func_v4`) were
failing in CI with a `ValueError: no option named 'keep_containers'`.

This occurred because the environments were missing the `requirements-test.txt`
dependency, so `pytest` and its plugins (like `pytest-docker`) were not
installed.

A previous refactoring of `tox.ini` made the environments more isolated,
exposing this latent dependency issue. This change adds the required
test dependencies to the functional test environments, ensuring they
are self-contained and run reliably.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

X Tutup