def make_comparison_tests(klass, kwargs1, kwargs2):
 def instance(kwargs):
  if isinstance(kwargs, dict):
   return klass(**kwargs)
  return klass(**kwargs())
 class Tests(TestCase, ):
  def test_equality(self):
   '\n            Instances with the same arguments are equal.\n            '
   self.assertTrue((instance(kwargs1) == instance(kwargs1)))
   self.assertFalse((instance(kwargs1) == instance(kwargs2)))
  def test_notequality(self):
   '\n            Instance with different arguments are not equal.\n            '
   self.assertTrue((instance(kwargs1) != instance(kwargs2)))
   self.assertFalse((instance(kwargs1) != instance(kwargs1)))
 Tests.__name__ = (klass.__name__ + 'ComparisonTests')
 return Tests

def make_comparison_tests ( klass , kwargs1 , kwargs2 ) : def instance ( kwargs ) : if isinstance ( kwargs , dict ) : return klass ( ** kwargs ) return klass ( ** kwargs ( ) ) class Tests ( TestCase , ) : def test_equality ( self ) : self . assertTrue ( ( instance ( kwargs1 ) == instance ( kwargs1 ) ) ) self . assertFalse ( ( instance ( kwargs1 ) == instance ( kwargs2 ) ) ) def test_notequality ( self ) : self . assertTrue ( ( instance ( kwargs1 ) != instance ( kwargs2 ) ) ) self . assertFalse ( ( instance ( kwargs1 ) != instance ( kwargs1 ) ) ) Tests . __name__ = ( klass . __name__ + 'ComparisonTests' ) return Tests
create tests to verify a class provides standard == and != behavior .