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.3.tar.gz (4.3 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.3.tar.gz.

File metadata

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

File hashes

Hashes for codemod-unittest-to-pytest-asserts-1.0.3.tar.gz
Algorithm Hash digest
SHA256 5a590ce7bca5fe02750b20231d51ac148a6a90e598627d301c47c3b56b5a0130
MD5 dd9da49bea7639e5d13ddd2b801cb66e
BLAKE2b-256 1cafd7403bcc044f9b5d9e4828274da715f6fdff5168e143a968a4409c78208b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: codemod_unittest_to_pytest_asserts-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1

File hashes

Hashes for codemod_unittest_to_pytest_asserts-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ffdd9437939b8c5285f19c26197537dc7d5baa1c2e7fc533b66564592de6d5af
MD5 4118709ea477ab97fe1057ac0cc163bd
BLAKE2b-256 480b5807b6c99da6db84610bcdbfa930662c03dab926c445f32d74f0d922e044

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