Current Series Release Notes


New Features

  • This release added new checks related to unittest module:

    • [H211] Change assertTrue(isinstance(A, B)) by optimal assert like assertIsInstance(A, B).

    • [H212] Change assertEqual(type(A), B) by optimal assert like assertIsInstance(A, B)

    • [H213] Check for usage of deprecated assertRaisesRegexp

    • [H214] Change assertTrue/False(A in/not in B, message) to the more specific assertIn/NotIn(A, B, message)

    • [H215] Change assertEqual(A in B, True), assertEqual(True, A in B), assertEqual(A in B, False) or assertEqual(False, A in B) to the more specific assertIn/NotIn(A, B)


Upgrade Notes

  • Python 2.7 support has been dropped. Last release of hacking to support py2.7 is OpenStack Train. The minimum version of Python now supported by hacking is Python 3.5.


New Features

  • hacking is now compatible with flake8 3.x, which is a large rewrite of flake8. flake8 2.x is no longer supported.

Upgrade Notes

  • Support for local checks has been removed. This was not compatible with flake8 3.x. Users should migrate to the flake8’s native local plugins support.



This release includes below changes:

  • Transition to flake8 2.6.x:

    • flake8 2.6.x performed the conversion to pycodestyle (which is the new name of pep8). Remove the explicit dependencies of hacking as flake8 is going to pull in mccabe, pyflakes and pycodestyle in the versions that are needed.

  • Allow ‘wraps’ to be an alternative to autospec:

    • Don’t cause an H210 error if the mock.patch/mock.patch.object call uses the ‘wraps’ keyword. As that serves the same purpose in catching wrong attributes.


New Features

  • This release includes new checks, which are disabled by default:

    • [H210] Require ‘autospec’, ‘spec’, or ‘spec_set’ in mock.patch/mock.patch.object calls

    • [H204] Use assert(Not)Equal to check for equality.

    • [H205] Use assert(Greater|Less)(Equal) for comparison.