Registry / testing / pytestify

pytestify

JSON →
library1.5.0pypypi✓ verified 86d ago

A tool to automatically convert Python unittest-style tests to pytest. Current version 1.5.0 supports Python 3.7+. Converts assert methods, TestCase classes, setUp/tearDown, and more. Releases are infrequent, mainly maintenance.

pip install pytestify
INSTALL
IMPORT
SIG · PYTESTIFY
P
pytestify
testingpythonv1.5.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pytestify
import pytestify
pytestify is used as a CLI tool, not typically imported in Python code.

Run from command line. Pass files or directories. Use --recursive for directories, --dry-run to preview.

# Convert a single file pytestify my_test_file.py # Convert a directory recursively pytestify tests/ --recursive # See what changes would be made without modifying files (dry run) pytestify my_test_file.py --dry-run
Debug
Known issues
gotchapytestify may not correctly handle complex assertions like assertAlmostEqual with custom delta, or assertRaises with custom exceptions. Always review the converted code.
fix
Manually verify conversions, especially edge cases with custom assertions.
affects: all
gotchaUsing --recursive on a large directory without --dry-run can modify many files unexpectedly.
fix
Always run with --dry-run first, then apply changes with --recursive only after reviewing.
affects: all
gotchapytestify converts assertTrue/assertFalse to `assert` but does not handle the opposite boolean logic correctly in all cases (e.g., assertFalse with complex expressions).
fix
Inspect converted assertFalse statements to ensure the negation is correct.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pytestify'
pytestify is not installed.
fix
Run 'pip install pytestify'
pytestify: error: unrecognized arguments: --recursive
Older version of pytestify (pre-1.0.0) did not have the --recursive flag.
fix
Upgrade to the latest version: 'pip install --upgrade pytestify'
Upgrade
Version history
1.5.0latest on PyPI · released Jun 4, 2023
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
pytestify — pip install pytestify · libregistry