diff --git a/cinder/tests/hacking/checks.py b/cinder/tests/hacking/checks.py index 291e65fcca9..87c515fc8ea 100644 --- a/cinder/tests/hacking/checks.py +++ b/cinder/tests/hacking/checks.py @@ -309,20 +309,6 @@ def check_datetime_now(logical_line, noqa): yield(0, msg) -_UNICODE_USAGE_REGEX = re.compile(r'\bunicode *\(') - - -@core.flake8ext -def check_unicode_usage(logical_line, noqa): - if noqa: - return - - msg = "C302: Found unicode() call. Please use six.text_type()." - - if _UNICODE_USAGE_REGEX.search(logical_line): - yield(0, msg) - - @core.flake8ext def check_no_print_statements(logical_line, filename, noqa): # CLI and utils programs do need to use 'print()' so diff --git a/cinder/tests/unit/test_hacking.py b/cinder/tests/unit/test_hacking.py index 1a51bf15095..6748daacd31 100644 --- a/cinder/tests/unit/test_hacking.py +++ b/cinder/tests/unit/test_hacking.py @@ -219,12 +219,6 @@ class HackingTestCase(test.TestCase): self.assertEqual(0, len(list(checks.check_timeutils_strtime( "strftime")))) - def test_check_unicode_usage(self): - self.assertEqual(1, len(list(checks.check_unicode_usage( - "unicode(msg)", False)))) - self.assertEqual(0, len(list(checks.check_unicode_usage( - "unicode(msg) # noqa", True)))) - def test_no_print_statements(self): self.assertEqual(0, len(list(checks.check_no_print_statements( "a line with no print statement", diff --git a/tox.ini b/tox.ini index 4c2999b8900..be741db7a0d 100644 --- a/tox.ini +++ b/tox.ini @@ -199,24 +199,20 @@ max-complexity = 30 application-import-names = cinder import-order-style = pep8 -[hacking] -import_exceptions = cinder.i18n - [flake8:local-plugins] extension = - C312 = checks:no_translate_logs N322 = checks:no_mutable_default_args N323 = checks:check_explicit_underscore_import - C310 = checks:CheckLoggingFormatArgs - C311 = checks:CheckOptRegistrationArgs C301 = checks:check_datetime_now + C303 = checks:check_no_print_statements C306 = checks:check_timeutils_strtime C308 = checks:check_timeutils_isotime - C302 = checks:check_unicode_usage - C303 = checks:check_no_print_statements - C336 = checks:dict_constructor_with_list_copy C309 = checks:no_test_log + C310 = checks:CheckLoggingFormatArgs + C311 = checks:CheckOptRegistrationArgs + C312 = checks:no_translate_logs C313 = checks:validate_assertTrue + C336 = checks:dict_constructor_with_list_copy paths = ./cinder/tests/hacking [doc8]