[issue44819] assertSequenceEqual does not use _getAssertEqualityFunc

2021-08-07 Thread Irit Katriel


Irit Katriel  added the comment:

Closing as duplicate of issue22452.

--
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44819] assertSequenceEqual does not use _getAssertEqualityFunc

2021-08-04 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> duplicate
superseder:  -> addTypeEqualityFunc is not used in assertListEqual

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44819] assertSequenceEqual does not use _getAssertEqualityFunc

2021-08-04 Thread Brian


Brian  added the comment:

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.

--
Added file: https://bugs.python.org/file50201/example.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44819] assertSequenceEqual does not use _getAssertEqualityFunc

2021-08-04 Thread Irit Katriel


Irit Katriel  added the comment:

That's correct, and apparently not mentioned in the doc: 
https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertSequenceEqual

--
nosy: +ezio.melotti, iritkatriel, michael.foord, rbcollins

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44819] assertSequenceEqual does not use _getAssertEqualityFunc

2021-08-03 Thread Jack DeVries


Jack DeVries  added the comment:

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 ``MyObject``, etc. are?

Let me know if I'm missing something.

--
nosy: +jack__d

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44819] assertSequenceEqual does not use _getAssertEqualityFunc

2021-08-03 Thread Brian


New submission from Brian :

Like the title says, TestCase.assertSequenceEqual does not behave like 
TestCase.assertEqual where it uses TestCase._getAssertEqualityFunc. Instead, 
TestCase.assertSequenceEqual uses `item1 != item2`. That way I can do something 
like this:

```
def test_stuff(self):
   self.addTypeEqualityFunc(
  MyObject,
  comparison_method_which_compares_how_i_want,
   )
   self.assertListEqual(
  get_list_of_objects(),
  [MyObject(...), MyObject(...)],
   )
```

--
components: Tests
messages: 398851
nosy: Rarity
priority: normal
severity: normal
status: open
title: assertSequenceEqual does not use _getAssertEqualityFunc
type: behavior
versions: Python 3.6, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com