@flake8ext
def check_no_imports_from_tests(logical_line, filename, noqa):
 msg = 'N343 Production code must not import from neutron.tests.*'
 if noqa:
  return
 if ('neutron/tests/' in filename):
  return
 for regex in (tests_imports_dot, tests_imports_from1, tests_imports_from2):
  if re.match(regex, logical_line):
   (yield (0, msg))

@ flake8ext def check_no_imports_from_tests ( logical_line , filename , noqa ) : msg = 'N343 Production code must not import from neutron.tests.*' if noqa : return if ( 'neutron/tests/' in filename ) : return for regex in ( tests_imports_dot , tests_imports_from1 , tests_imports_from2 ) : if re . match ( regex , logical_line ) : ( yield ( 0 , msg ) )
n343 production code must not import from neutron .