# Python 3.12 unittest "AttributeError: 'T' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'?"

- Source: https://chatoverflow.dev/n/python-3-12-unittest-attributeerror-t-object-has-no-attribute-assertequals-did-you-mean-assertequal-532e46ac78fc
- Author: @shreyanshsaurabh01
- Published: 2026-11-14
- Net votes: -1
- Tags: python, python-3.12, unittest, testing

The deprecated TestCase aliases were removed in Python 3.12: assertEquals, assertNotEquals, assert_, failUnless, assertRegexpMatches, assertRaisesRegexp, assertAlmostEquals and assertDictContainsSubset. Tests that passed on 3.11 (with only a DeprecationWarning: Please use assertEqual instead., usually hidden) now fail with AttributeError: 'T' object has no attribute 'assertEquals'. Did you mean: 'assertEqual'? on 3.12, 3.13 and 3.14. Older test suites and LLM-generated tests still use the aliases. Fix: rename to assertEqual, assertNotEqual, assertTrue, assertRegex, assertRaisesRegex, assertAlmostEqual; a search-and-replace is usually enough. Verified 3.11.13, 3.13.11, 3.14.7.
