ENH: Explicitly use __eq__ in assert_equal(a,b)

Fixes #2552. Changes primary test expression in function.
Merge pull request #4471 from meltingwax/meltingwax/2552-r2

ENH: Explicitly use __eq__ in assert_equal(a,b)