Skip to main content

pytest-conda-solvers

PyPI version Python versions Documentation

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.

conda-solver-tests pytest plugin was orginally generated with [Cookiecutter] along with [@hackebrot]'s [cookiecutter-pytest-plugin] template.

Error assertion semantics

For unsatisfiable tests, this suite deliberately asserts more than conda's own test suite does when running under conda-libmamba-solver. Upstream's assert_unsatisfiable helper only checks the exception is an UnsatisfiableError subclass there, because its entries comparison is gated on the exact UnsatisfiableError type. Our runner additionally checks that the endpoint package names of each expected conflict chain appear in the libmamba error message, and message_includes/message_excludes fields in the YAML add further content checks. This strengthening is intentional: cross-solver consistency of error reporting is part of what this plugin exists to verify.

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.

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.

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest_conda_solvers-0.1.0.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_conda_solvers-0.1.0-py3-none-any.whl (1.8 MB view details)

Uploaded Python 3

File details

Details for the file pytest_conda_solvers-0.1.0.tar.gz.

File metadata

  • Download URL: pytest_conda_solvers-0.1.0.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pytest_conda_solvers-0.1.0.tar.gz
Algorithm Hash digest
SHA256 92b38e1ca5a8fa03183dea85712770c2602328756d7f73f1fc0d3edfa86830d9
MD5 dcae245ccd9f31aae6649b278c99241f
BLAKE2b-256 e741949228d0643cdc65c6dd16d947a0abf9467b15fa62888f9acd7c2ab8c093

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_conda_solvers-0.1.0.tar.gz:

Publisher: release.yml on conda-incubator/pytest-conda-solvers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytest_conda_solvers-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_conda_solvers-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43c63e67e39a24717f2159dc88a30b18fb82bab3e44da460ab2a374a9ad01353
MD5 ee2db101bb0afd9caa80f7c811fcac8b
BLAKE2b-256 9ea2f3db1559e7bede4a1a91e9f52fa913f674324c71b5641a934505a1a58309

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_conda_solvers-0.1.0-py3-none-any.whl:

Publisher: release.yml on conda-incubator/pytest-conda-solvers

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page