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 you want to refactor:

codemod-unittest-to-pytest-asserts some-python-files.py

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.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distributions

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

File metadata

  • Download URL: codemod-unittest-to-pytest-asserts-1.0.0.tar.gz
  • Upload date:
  • Size: 3.3 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.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.0.tar.gz
Algorithm Hash digest
SHA256 1d9db37534c41a8c8de92892c6744a353462f43128d04cf55adebeb3dd33a6e9
MD5 9b72b3fe827484dff81194a2b59fe0cf
BLAKE2b-256 62b6e37f5e61a5b192c0c178f14f2b18746859295dd1c8e893d5bfcdbd0d1d7e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: codemod_unittest_to_pytest_asserts-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 2.9 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ff6fb91cc248af703fe360633e3345aada47dacbde4cc38563f117729128ede7
MD5 006cdc1e206d3a01ab6de8e0c82e19d1
BLAKE2b-256 02bd086f08f9232b03ac158249325eaf57b44d1e68aae825db4a78f7d699b1b9

See more details on using hashes here.

File details

Details for the file codemod_unittest_to_pytest_asserts-1.0.0-py2-none-any.whl.

File metadata

  • Download URL: codemod_unittest_to_pytest_asserts-1.0.0-py2-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 2
  • 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.0-py2-none-any.whl
Algorithm Hash digest
SHA256 8f4a6c3ed4e1c0b97da414c6262d6b238a1afbca09c8f27776979549e0acd959
MD5 87d9f5d15910792a65e3d057eb08b9aa
BLAKE2b-256 ae14e075377c4f3a3779473d251b87dbf8e899b1027741c470cbac86375fc425

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