New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
assertSequenceEqual does not use _getAssertEqualityFunc #88982
Comments
Like the title says, TestCase.assertSequenceEqual does not behave like TestCase.assertEqual where it uses TestCase._getAssertEqualityFunc. Instead, TestCase.assertSequenceEqual uses
|
Brian, can you be more specific about what problem is caused by the fact that assertSequenceEqual does not use _getAssertEqualityFunc? Also, I'm not sure what your example is trying to demonstrate. Can you provide a minimal example that shows the problem, but also defines what Let me know if I'm missing something. |
That's correct, and apparently not mentioned in the doc: https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertSequenceEqual |
I've attached an example of what I want. It contains a class, a function to be tested, and a test class which tests the function. What TestCase.addTypeEqualityFunc feels like it offers is a chance to compare objects however I feel like is needed for each test. Sometimes all I want is to compare the properties of the objects, and maybe not even all of the properties! When I have a list of these objects and I've added an equality function for the object, I was expecting the test class to use my equality function when comparing objects in the list. |
Closing as duplicate of bpo-22452. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: