diff options
author | Benjamin Peterson <benjamin@python.org> | 2016-07-14 04:13:29 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2016-07-14 04:13:29 (GMT) |
commit | ab078e9ed1a5d1b693d6ee843f1a34e8993e9dee (patch) | |
tree | 55e6e21b81315f126e76357af7e545cfe498d778 /Lib/test/test_functools.py | |
parent | fb4f8257bfa4471764e10c1d8525a5bb7b0145e5 (diff) | |
download | cpython-ab078e9ed1a5d1b693d6ee843f1a34e8993e9dee.zip cpython-ab078e9ed1a5d1b693d6ee843f1a34e8993e9dee.tar.gz cpython-ab078e9ed1a5d1b693d6ee843f1a34e8993e9dee.tar.bz2 |
Backed out changeset af29d89083b3 (closes #25548) (closes #27498)
Diffstat (limited to 'Lib/test/test_functools.py')
-rw-r--r-- | Lib/test/test_functools.py | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py index e2ab654..06eacfb 100644 --- a/Lib/test/test_functools.py +++ b/Lib/test/test_functools.py @@ -1758,10 +1758,13 @@ class TestSingleDispatch(unittest.TestCase): c.Container.register(P) with self.assertRaises(RuntimeError) as re_one: g(p) - self.assertIn("Ambiguous dispatch:", str(re_one.exception)) - self.assertIn("<class 'collections.abc.Container'", str(re_one.exception)) - self.assertIn("<class 'collections.abc.Iterable'", str(re_one.exception)) - + self.assertIn( + str(re_one.exception), + (("Ambiguous dispatch: <class 'collections.abc.Container'> " + "or <class 'collections.abc.Iterable'>"), + ("Ambiguous dispatch: <class 'collections.abc.Iterable'> " + "or <class 'collections.abc.Container'>")), + ) class Q(c.Sized): def __len__(self): return 0 @@ -1787,10 +1790,13 @@ class TestSingleDispatch(unittest.TestCase): # perspective. with self.assertRaises(RuntimeError) as re_two: h(c.defaultdict(lambda: 0)) - self.assertIn("Ambiguous dispatch:", str(re_two.exception)) - self.assertIn("<class 'collections.abc.Container'", str(re_two.exception)) - self.assertIn("<class 'collections.abc.Sized'", str(re_two.exception)) - + self.assertIn( + str(re_two.exception), + (("Ambiguous dispatch: <class 'collections.abc.Container'> " + "or <class 'collections.abc.Sized'>"), + ("Ambiguous dispatch: <class 'collections.abc.Sized'> " + "or <class 'collections.abc.Container'>")), + ) class R(c.defaultdict): pass c.MutableSequence.register(R) @@ -1824,10 +1830,13 @@ class TestSingleDispatch(unittest.TestCase): # There is no preference for registered versus inferred ABCs. with self.assertRaises(RuntimeError) as re_three: h(u) - self.assertIn("Ambiguous dispatch:", str(re_three.exception)) - self.assertIn("<class 'collections.abc.Container'", str(re_three.exception)) - self.assertIn("<class 'collections.abc.Sized'", str(re_three.exception)) - + self.assertIn( + str(re_three.exception), + (("Ambiguous dispatch: <class 'collections.abc.Container'> " + "or <class 'collections.abc.Sized'>"), + ("Ambiguous dispatch: <class 'collections.abc.Sized'> " + "or <class 'collections.abc.Container'>")), + ) class V(c.Sized, S): def __len__(self): return 0 |