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.0.5.tar.gz.

File metadata

  • Download URL: codemod-unittest-to-pytest-asserts-1.0.5.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for codemod-unittest-to-pytest-asserts-1.0.5.tar.gz
Algorithm Hash digest
SHA256 c372cde0dcec9fa492c2d8441a299222738b21d4191deee325eec7894cb8caef
MD5 276cb1546dfc19a6575fcab88da11e1f
BLAKE2b-256 c9c22f9fadb59a928ee614b82b65b3172397d4af93aed81776122f980302a486

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for codemod_unittest_to_pytest_asserts-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 18599e2a8ca8271b8d03fed38cb72554aad106baad47a8d984c47b0cd86073e7
MD5 01f36408f9cb67701685c53b3a5eb2bc
BLAKE2b-256 fcdbed0abc276e40d8742cdd0329f5b740c9a91fbc2b3eaa7ab668615f71fed5

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