sympy/sympy — pull request #7729 by smichr (2014-07-11 14:07:03+00:00)
Title: Unchanged function added and all obj have `__eq__` method

There needs to be a better way to test that the do-nothing exit of an eval routine is working. Commonly, this is tested by writing something like `assert foo(0) == foo(0)`...except for Dummy (where Dummy() != Dummy()) such a statement will always be true. To handle such tests, a function named `unchanged` has been added that allows one to assert that the function and arguments used to build the object remain unchanged, e.g. `foo(0).func is foo and foo(0).args == (0,)`.

There is another case when such functions are used: to show that something no longer fails. In this case one doesn't care what the output is, only that it doesn't fail. The `unchanged` function will ignore tests that have an inline after them. This encourages users to tell why an apparently do-nothing test is being added: `assert foo(0) == foo(0) # doesn't fail` will not raise an error during code quality checks.

Another test that has been added to the code quality checks is one to see that every object has an `__eq__` method.