← All recipes
Moderne licensed

Replace deprecated unittest method aliases

Recipe IDorg.openrewrite.python.migrate.ReplaceUnittestDeprecatedAliasesArtifactopenrewrite-migrate-python

Replace deprecated unittest.TestCase method aliases like assertEquals with their modern equivalents like assertEqual. These aliases were removed in Python 3.11/3.12.

Single recipeProprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe org.openrewrite.python.migrate.ReplaceUnittestDeprecatedAliases

If the recipe isn’t available locally, install it with:

mod config recipes pip install openrewrite-migrate-python