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.1.0.tar.gz
.
File metadata
- Download URL: codemod-unittest-to-pytest-asserts-1.1.0.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84f0100ac713c7e8b8c06953f97a24456534f596d33775e735aab317abbe7dfe |
|
MD5 | 911033999be22f8dfa6472d6d48d401a |
|
BLAKE2b-256 | b294a25342605a8c83a20de4f9cdeff4c1eb9b9e55b13e3c9cf70c5b6c971657 |
File details
Details for the file codemod_unittest_to_pytest_asserts-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: codemod_unittest_to_pytest_asserts-1.1.0-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.10.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f984afac053faad05a2640fa688021b5ed5ac8d6ffb739a870fc377e3821f84e |
|
MD5 | 53a7d90a5b792500c4ddfe440f556aa3 |
|
BLAKE2b-256 | b63e759729970716ce0f83d6f399b3462ed68ed0cdcfe2fd4e7eec7c023e8d0a |