A pytest plugin to run tests using unittest-style test IDs
Project description
pytest-unittest-id-runner
This project provides a simple pytest plugin that converts unittest-style test identifiers into pytest-style test identifiers when passed as file_or_dir arguments to pytest on the command line.
This plug allows the following
pytest path.to.test_file.TestClass.test_method
to be used instead of
pytest path/to/test_file.py::TestClass::test_method
Installation
The plugin can be installed with:
pip install pytest-unittest-id-runner
Once installed, the plugin automatically attempts to perform the test identifier conversion without further configuration.
Motivation
This plugin fills a fairly specific niche.
There are some projects out there that use unittest for testing instead of pytest, but they use unittest in a straightforward way, so that pytest can run the tests with its unittest compatibility support.
When working on such a project, one may prefer to work with the tests locally using pytest.
One motivation for doing this could be using a particular pytest feature or plugin for debugging test failures, since the pytest ecosystem is much bigger than unittest's.
In this case, one will find that the tests are run in CI with unittest and the failures are printed in the unittest style.
With pytest-unittest-id-runner installed, one can simply copy and paste the unittest identifiers from the CI output onto a pytest command line in order to debug the tests locally and not worry about converting between unittest and pytest styles of test identifier.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytest_unittest_id_runner-0.1.1.tar.gz.
File metadata
- Download URL: pytest_unittest_id_runner-0.1.1.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
756b162e44b8a099110f963844e75604563909a59bdcf1f341e79415386ea2b3
|
|
| MD5 |
67f39c49758eaf385a14cfc0038ccda4
|
|
| BLAKE2b-256 |
291319627c7f2c660e77359e5edee62f7dce3ea9d94124dd93c75426b147d2e9
|
Provenance
The following attestation bundles were made for pytest_unittest_id_runner-0.1.1.tar.gz:
Publisher:
python-publish.yml on wshanks/pytest-unittest-id-runner
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytest_unittest_id_runner-0.1.1.tar.gz -
Subject digest:
756b162e44b8a099110f963844e75604563909a59bdcf1f341e79415386ea2b3 - Sigstore transparency entry: 169908939
- Sigstore integration time:
-
Permalink:
wshanks/pytest-unittest-id-runner@f4df81ad7ff1ebb973e0ce385a1a3b77564b6b37 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/wshanks
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@f4df81ad7ff1ebb973e0ce385a1a3b77564b6b37 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pytest_unittest_id_runner-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pytest_unittest_id_runner-0.1.1-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e8be2054e10487ddc0baef113067a80391b6503d4cdc0ced420c162198c5e5a
|
|
| MD5 |
bc2e5cdae901c34a8a612f2e9e02a6b6
|
|
| BLAKE2b-256 |
dae08645deac954bbe6adb08880020d2d0723b8d21f6519e3e9c576b22b15de3
|
Provenance
The following attestation bundles were made for pytest_unittest_id_runner-0.1.1-py3-none-any.whl:
Publisher:
python-publish.yml on wshanks/pytest-unittest-id-runner
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pytest_unittest_id_runner-0.1.1-py3-none-any.whl -
Subject digest:
4e8be2054e10487ddc0baef113067a80391b6503d4cdc0ced420c162198c5e5a - Sigstore transparency entry: 169908941
- Sigstore integration time:
-
Permalink:
wshanks/pytest-unittest-id-runner@f4df81ad7ff1ebb973e0ce385a1a3b77564b6b37 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/wshanks
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@f4df81ad7ff1ebb973e0ce385a1a3b77564b6b37 -
Trigger Event:
release
-
Statement type: