@flake8ext
def check_assertempty(logical_line, filename):
 if ('neutron/tests/' in filename):
  msg = 'N330: Use assertEqual(*empty*, observed) instead of assertEqual(observed, *empty*). *empty* contains {}, [], (), set(), \'\', ""'
  empties = '(\\[\\s*\\]|\\{\\s*\\}|\\(\\s*\\)|set\\(\\s*\\)|\'\\s*\'|\\"\\s*\\")'
  reg = ('assertEqual\\(([^,]*,\\s*)+?%s\\)\\s*$' % empties)
  if re.search(reg, logical_line):
   (yield (0, msg))

@ flake8ext def check_assertempty ( logical_line , filename ) : if ( 'neutron/tests/' in filename ) : msg = 'N330: Use assertEqual(*empty*, observed) instead of assertEqual(observed, *empty*). *empty* contains {}, [], (), set(), \'\', ""' empties = '(\\[\\s*\\]|\\{\\s*\\}|\\(\\s*\\)|set\\(\\s*\\)|\'\\s*\'|\\"\\s*\\")' reg = ( 'assertEqual\\(([^,]*,\\s*)+?%s\\)\\s*$' % empties ) if re . search ( reg , logical_line ) : ( yield ( 0 , msg ) )
n330 - enforce using assertequal parameter ordering in case of empty objects .