Open exarkun opened 10 years ago
That sounds great, pull request (for all three cases) maybe? :)
Twisted has testutils.ComparisonTestsMixin.assertNormalEqualityImplementation
https://github.com/twisted/twisted/blob/trunk/twisted/test/testutils.py#L125
twisted.names.test.test_dns.MessageComparisonTests
(https://github.com/twisted/twisted/blob/trunk/twisted/names/test/test_dns.py#L870). But it's painful to have to write a separate test method for comparison of each attribute. So I guess we need to aim to generate test methods for every combination of attribute and equality assertion.With all that in mind, has anyone got any hints on the best way to implement this?
Removing milestone. Feel free to submit a pull request once you’ve settled on an approach.
One wants to unit test this sort of behavior but characteristic has enough information to automatically generate these tests in most cases.
Perhaps something like
MyClassEqualityTests = make_equality_tests(MyClass)
?