Files
nova/nova/hacking
Dan Smith f6e4713bf6 Add a hacking check for test method closures
A recurring pattern when using multiple mocks is to create a closure
decorated with mocks like:

    def test_thing(self):
            @mock.patch.object(self.compute, 'foo')
            @mock.patch.object(self.compute, 'bar')
            def _do_test(mock_bar, mock_foo):
                # Test things
        _do_test()

However it is easy to leave off the _do_test() and have the test pass
because nothing runs. This check looks for that pattern.

Co-Authored-By: Andrew Laski <andrew@lascii.com>
Change-Id: I4c2395a01470acc7c9e5bcf1d3578d00270a2c07
2016-03-17 15:49:55 -04:00
..
2013-05-17 12:54:12 -07:00