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

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

File details

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

File metadata

  • Download URL: codemod_unittest_to_pytest_asserts-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.8.0

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 Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page