[issue25669] unittest.assertEqual() on un-equal types inheriting from collections.Mapping

2015-11-23 Thread Michael Foord
Michael Foord added the comment: assertEqual *does* do type checking and it's strict that it will only resort to the "type specific" assert checks if both types are of the same type. In the general case it's impossible to know whether comparing a subclass with the type specific check is the

[issue25669] unittest.assertEqual() on un-equal types inheriting from collections.Mapping

2015-11-20 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +ezio.melotti, michael.foord, rbcollins ___ Python tracker ___

[issue25669] unittest.assertEqual() on un-equal types inheriting from collections.Mapping

2015-11-20 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: rhettinger -> ___ Python tracker ___

[issue25669] unittest.assertEqual() on un-equal types inheriting from collections.Mapping

2015-11-20 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- versions: +Python 3.6 -Python 2.7 ___ Python tracker ___

[issue25669] unittest.assertEqual() on un-equal types inheriting from collections.Mapping

2015-11-19 Thread Nathan Herring
Nathan Herring added the comment: FWIW, it's also pretty easy to write self.assertEqual({'key': 'value'}, dict(foo)) and get the right behavior, but it'd be nice if it was done automagically by type checking. -- ___ Python tracker

[issue25669] unittest.assertEqual() on un-equal types inheriting from collections.Mapping

2015-11-19 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger nosy: +rhettinger ___ Python tracker ___

[issue25669] unittest.assertEqual() on un-equal types inheriting from collections.Mapping

2015-11-19 Thread Nathan Herring
New submission from Nathan Herring: We have some code that generates objects that inherit from Mapping that are not nearly as straightforward to instantiate in a test. It's much easier to have something like the follows: foo = … # some collections.Mapping subtype self.assertEqual({'key':