Skip to main content

Codemod to refactor unittest assertions to pytest assertions.

Project description

A codemod to automatically refactor unittest assertions with pytest assertions.

Installation

This codemod requires Python 3.8 or newer.

With pip, assuming Python 3.8 or newer is used:

python3 -m pip install codemod-unittest-to-pytest-asserts

With pipx, assuming Python 3.8 exists on the system:

pipx install --python $(which python3.8) codemod-unittest-to-pytest-asserts

Usage

Run the installed command on the Python files or directory of files you want to refactor:

codemod-unittest-to-pytest-asserts some-python-files.py

or:

codemod-unittest-to-pytest-asserts some_directory/

You’ll be asked to confirm all changes.

It is recommended to run an autoformatter, like Black, after the refactoring.

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

Built Distribution

File details

Details for the file codemod-unittest-to-pytest-asserts-1.2.0.tar.gz.

File metadata

File hashes

Hashes for codemod-unittest-to-pytest-asserts-1.2.0.tar.gz
Algorithm Hash digest
SHA256 ed19eaeeb765756ffed4f97955f9ff2e68319819f608380bcbbb88907f3f2e95
MD5 262bae72201c17876e12a7aaec8a2676
BLAKE2b-256 f35758fc658672951fb370fc10c964de340280a36e4d2dd07f7d857a4a7456b7

See more details on using hashes here.

Provenance

File details

Details for the file codemod_unittest_to_pytest_asserts-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for codemod_unittest_to_pytest_asserts-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3980ce89c9e1e3c1afbce2b07a84a50fcf15a21d330337fb3610567fc875374d
MD5 3abeeffbec6e05a8524490b23788c435
BLAKE2b-256 c02dfd430816685775f4ba26e5cf1f7c94e530b62de57f3171c3835e2da72d6f

See more details on using hashes here.

Provenance

Supported by

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