Allow logging in tempest tests
Hacking rule C309 is meant to prevent adding logging to unit tests, but
it is also preventing logging in tempest in-tree tests, which should be
allowed.
This patch modifies method C309 check to allow logging in
cinder/tests/tempest
TrivialFix
@@ -440,7 +440,8 @@ def check_timeutils_isotime(logical_line):
def no_test_log(logical_line, filename, noqa):
- if "cinder/tests" not in filename or noqa:
+ if ('cinder/tests/tempest' in filename or
+ 'cinder/tests' not in filename or noqa):
return
msg = "C309: Unit tests should not perform logging."
if logging_instance.match(logical_line):
