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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

File details

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

File metadata

File hashes

Hashes for codemod_unittest_to_pytest_asserts-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c08da5cf3d3c0fba24fc9dc1707a22af222e4691e014f73eb4ca97e9b5cf28c6
MD5 f2a6b976ac893fbc044a41c3ddcda53f
BLAKE2b-256 25cb0d87fabca45b0d8a79422a2899e2ea62c62838d99363431f4d6a0d3f3f9c

See more details on using hashes here.

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