@flake8ext
def check_asserttruefalse(logical_line, filename):
 if ('neutron/tests/' in filename):
  if re.search('assertEqual\\(\\s*True,[^,]*(,[^,]*)?', logical_line):
   msg = 'N328: Use assertTrue(observed) instead of assertEqual(True, observed)'
   (yield (0, msg))
  if re.search('assertEqual\\([^,]*,\\s*True(,[^,]*)?', logical_line):
   msg = 'N328: Use assertTrue(observed) instead of assertEqual(True, observed)'
   (yield (0, msg))
  if re.search('assertEqual\\(\\s*False,[^,]*(,[^,]*)?', logical_line):
   msg = 'N328: Use assertFalse(observed) instead of assertEqual(False, observed)'
   (yield (0, msg))
  if re.search('assertEqual\\([^,]*,\\s*False(,[^,]*)?', logical_line):
   msg = 'N328: Use assertFalse(observed) instead of assertEqual(False, observed)'
   (yield (0, msg))

@ flake8ext def check_asserttruefalse ( logical_line , filename ) : if ( 'neutron/tests/' in filename ) : if re . search ( 'assertEqual\\(\\s*True,[^,]*(,[^,]*)?' , logical_line ) : msg = 'N328: Use assertTrue(observed) instead of assertEqual(True, observed)' ( yield ( 0 , msg ) ) if re . search ( 'assertEqual\\([^,]*,\\s*True(,[^,]*)?' , logical_line ) : msg = 'N328: Use assertTrue(observed) instead of assertEqual(True, observed)' ( yield ( 0 , msg ) ) if re . search ( 'assertEqual\\(\\s*False,[^,]*(,[^,]*)?' , logical_line ) : msg = 'N328: Use assertFalse(observed) instead of assertEqual(False, observed)' ( yield ( 0 , msg ) ) if re . search ( 'assertEqual\\([^,]*,\\s*False(,[^,]*)?' , logical_line ) : msg = 'N328: Use assertFalse(observed) instead of assertEqual(False, observed)' ( yield ( 0 , msg ) )
n328 - dont use assertequal .