pytest-conda-solvers#
A pytest plugin that runs shared conda solver YAML tests against classic, libmamba, or other conda solver backends.
The PyPI package ships the plugin, fixtures, mock channel data, and shared
YAML suite under pytest_conda_solvers/. When the plugin loads, it
automatically adds the bundled suite to pytest’s collection.
Warning
This project is still in early stages of development. Don’t use it in production (yet). We do welcome feedback on what the expected behaviour should have been if something doesn’t work!
Requirements#
Python ≥ 3.10
A working conda (>=26.3.0) installation in the environment (install via conda, mamba, or pixi — not from PyPI)
The solver backend under test (for example
conda-libmamba-solver)
Installation#
conda create -n solver-test-env conda conda-libmamba-solver pip
conda activate solver-test-env
python -m pip install pytest-conda-solvers
For local development from a checkout:
pixi install
# or: pip install -e .
Usage#
Select a solver with --conda-solver; the bundled suite is collected automatically:
pytest --conda-solver=libmamba
pytest --conda-solver=classic
Paths passed to pytest are collected alongside the bundled suite, so solver authors can add their own Python or YAML tests normally.
Use --no-bundled-solver-tests to collect custom tests without the suite
shipped by this package.
From this repository with pixi:
pixi run test-libmamba-solver
pixi run test-classic-solver
The plugin collects solver-suite .yaml files, starts a session-scoped mock
channel server, and runs each case through the selected solver backend. See
the Quick start tutorial for a walkthrough.
Contributing#
Contributions are welcome. It is recommended to use pixi for the development environment and run the solver test tasks above before opening a pull request. See Adding a test to contribute a new solver test case.
Build the documentation locally with pixi run -e docs docs-build.
License#
Distributed under the BSD-3-Clause license.
Issues#
If you encounter problems, please file an issue.
Install the plugin and run the bundled solver test suite in a few minutes.
Task-oriented guides for extending the suite, such as adding a new test.
The dataset’s structure and the full JSON Schema for every test field.
Background on why this project exists and how it strengthens error checks.