Skip to main content

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 find that the tests are run in CI with unittest and the failures are printed in the unittest style. With this plugin installed, one simply copy and paste the unittest identifiers 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


Download files

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

Source Distribution

pytest_unittest_id_runner-0.1.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

pytest_unittest_id_runner-0.1.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for pytest_unittest_id_runner-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2dca2d5caa9a8094b03b252709029d0524ffc9254c53a3cf066e8e17b26c98c6
MD5 5cbc21648022bedaa567fd146aff7e77
BLAKE2b-256 0d483f89196acbe02dd724fec8253cd9f0108ba0b7b3a52e97ab98630142eb67

See more details on using hashes here.

Provenance

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

Publisher: python-publish.yml on wshanks/pytest-unittest-id-runner

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_unittest_id_runner-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_unittest_id_runner-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f680ba6d00cd3284564e38eadb4c611789e17bd94193cc7e86561a3bf0506f01
MD5 cc0ce7f5e96223b03294cf60d172eb52
BLAKE2b-256 e6d232a6141c4520e68aa2b68ba64acc6b99fae343ab4b96fb621b5e7dc989dc

See more details on using hashes here.

Provenance

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

Publisher: python-publish.yml on wshanks/pytest-unittest-id-runner

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page