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

codemod-unittest-to-pytest-asserts-1.0.2.tar.gz (5.2 kB view details)

Uploaded Source

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

File metadata

  • Download URL: codemod-unittest-to-pytest-asserts-1.0.2.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0

File hashes

Hashes for codemod-unittest-to-pytest-asserts-1.0.2.tar.gz
Algorithm Hash digest
SHA256 3f734badec15dd9c885bf2e97c7c514a51fe38e9466618579324d458440f140f
MD5 5616e9de056a9e1e1185f72f892070cd
BLAKE2b-256 3a718a51233ef983a4506f01797728334d38f58d7bb338b1efbb8db03551ccd0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: codemod_unittest_to_pytest_asserts-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.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.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.0

File hashes

Hashes for codemod_unittest_to_pytest_asserts-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0c75c24e8630b4c02243cc674b610793f3a98c93f428146483f96547c5a465bf
MD5 4fcc44560dbb0fc206bd069610c3f3aa
BLAKE2b-256 5110720fc9316c456aae4ae26fc41f606521bcb6e66490ea5c9784cf6583d57b

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