def assertNotEquals( exp, got, msg = None ):
    """assertNotEquals( exp, got[, message] )

    Two objects test as "equal" if:
    
    * they are the same object as tested by the 'is' operator.
    * either object is a float or complex number and the absolute
      value of the difference between the two is less than 1e-8.
    * applying the equals operator ('==') returns True.
    """
    if exp is got:
        r = False
    elif ( type( exp ) in ( FloatType, ComplexType ) or
           type( got ) in ( FloatType, ComplexType ) ):
        r = abs( exp - got ) >= 1e-8
    else:
        r = ( exp != got )
    if not r:
        print >>sys.stderr, "Error: expected different values but both are equal to <%s>%s" % ( repr( exp ), colon( msg ) )
        traceback.print_stack()
assertNotEquals( exp, got[, message] )

    Two objects test as "equal" if:
    
    * they are the same object as tested by the 'is' operator.
    * either object is a float or complex number and the absolute
      value of the difference between the two is less than 1e-8.
    * applying the equals operator ('==') returns True.
    
recipes/Python/577538_Poor_Man_unit_tests/recipe-577538.py