Merge "Hacking: remove check for "tests/unit/integrated""

This commit is contained in:
Jenkins 2016-10-03 15:25:26 +00:00 committed by Gerrit Code Review
commit 5f941c66ff
2 changed files with 1 additions and 5 deletions

View File

@ -482,9 +482,6 @@ def check_timeutils_isotime(logical_line):
def no_test_log(logical_line, filename, noqa): def no_test_log(logical_line, filename, noqa):
if "cinder/tests" not in filename or noqa: if "cinder/tests" not in filename or noqa:
return return
# Skip the "integrated" tests for now
if "cinder/tests/unit/integrated" in filename:
return
msg = "C309: Unit tests should not perform logging." msg = "C309: Unit tests should not perform logging."
if logging_instance.match(logical_line): if logging_instance.match(logical_line):
yield (0, msg) yield (0, msg)

View File

@ -443,8 +443,7 @@ class HackingTestCase(test.TestCase):
(1, 'LOG.debug', "cinder/tests/fake.py", False), (1, 'LOG.debug', "cinder/tests/fake.py", False),
(0, 'LOG.info.assert_called_once_with', "cinder/tests/fake.py", False), (0, 'LOG.info.assert_called_once_with', "cinder/tests/fake.py", False),
(0, 'some.LOG.error.call', "cinder/tests/fake.py", False), (0, 'some.LOG.error.call', "cinder/tests/fake.py", False),
(0, 'LOG.warning', "cinder/tests/unit/fake.py", True), (0, 'LOG.warning', "cinder/tests/unit/fake.py", True))
(0, 'LOG.warning', "cinder/tests/unit/integrated/fake.py", False))
def test_no_test_log(self, first, second, third, fourth): def test_no_test_log(self, first, second, third, fourth):
self.assertEqual(first, len(list(checks.no_test_log( self.assertEqual(first, len(list(checks.no_test_log(
"%s('arg')" % second, third, fourth)))) "%s('arg')" % second, third, fourth))))