Detecting incorrect assertion methods : <p>During one of the recent code reviews, I've stumbled upon the problem that was not immediately easy to spot - there was <code>assertTrue()</code> used instead of <code>assertEqual()</code> that basically resulted into a test that was <em>testing nothing</em>. Here is a simplified example:</p>

<pre><code>from unittest import TestCase


class MyTestCase(TestCase):
    def test_two_things_equal(self):
        self.assertTrue("a", "b")
</code></pre>

<p>The problem here is that the test would pass; and technically, the code is valid, since <a href="https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertTrue" rel="noreferrer"><code>assertTrue</code> has this optional <code>msg</code> argument</a> (that gets the <code>"b"</code> value in this case).</p>

<p>Can we do better than rely on the person reviewing the code to spot this kind of problems? Is there a way to <em>auto-detect</em> it using static code analysis with <code>flake8</code> or <code>pylint</code>?</p>
