Improve H212 failure message

This currently fails with:

  H212: Use assert{type(A),B} instance

which makes no sense. What we actually want is for users to use use
assertIsInstance. Correct this.

Change-Id: I99b01bf2349aede0e90b5fb3702c5637aad412bc
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
This commit is contained in:
Stephen Finucane 2023-05-03 11:51:37 +01:00
parent 8d0a4a1874
commit f4c3128ac9

View File

@ -269,7 +269,7 @@ def hacking_assert_equal_type(logical_line):
if RE_ASSERT_EQUAL_TYPE.match(logical_line): if RE_ASSERT_EQUAL_TYPE.match(logical_line):
yield ( yield (
0, 0,
"H212: Use assert{type(A),B} instance") "H211: Use assert{Is,IsNot}instance")
@core.flake8ext @core.flake8ext