summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_functools.py
diff options
context:
space:
mode:
authorKushal Das <kushaldas@gmail.com>2016-06-04 23:21:13 (GMT)
committerKushal Das <kushaldas@gmail.com>2016-06-04 23:21:13 (GMT)
commit5801ecb4408cd11f6e6ffcb1612ca68d9936a728 (patch)
treed50a9aa79b55eb92dde2c12908d6ecb14fc7f1d5 /Lib/test/test_functools.py
parent409482251b06fe75c4ee56e85ffbb4b23d934159 (diff)
downloadcpython-5801ecb4408cd11f6e6ffcb1612ca68d9936a728.zip
cpython-5801ecb4408cd11f6e6ffcb1612ca68d9936a728.tar.gz
cpython-5801ecb4408cd11f6e6ffcb1612ca68d9936a728.tar.bz2
Issue #25548: Showing memory address of class objects in repl
Diffstat (limited to 'Lib/test/test_functools.py')
-rw-r--r--Lib/test/test_functools.py33
1 files changed, 12 insertions, 21 deletions
diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py
index 9cf115d..852173c 100644
--- a/Lib/test/test_functools.py
+++ b/Lib/test/test_functools.py
@@ -1697,13 +1697,10 @@ class TestSingleDispatch(unittest.TestCase):
c.Container.register(P)
with self.assertRaises(RuntimeError) as re_one:
g(p)
- 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'>")),
- )
+ 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))
+
class Q(c.Sized):
def __len__(self):
return 0
@@ -1729,13 +1726,10 @@ class TestSingleDispatch(unittest.TestCase):
# perspective.
with self.assertRaises(RuntimeError) as re_two:
h(c.defaultdict(lambda: 0))
- 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'>")),
- )
+ 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))
+
class R(c.defaultdict):
pass
c.MutableSequence.register(R)
@@ -1769,13 +1763,10 @@ class TestSingleDispatch(unittest.TestCase):
# There is no preference for registered versus inferred ABCs.
with self.assertRaises(RuntimeError) as re_three:
h(u)
- 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'>")),
- )
+ 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))
+
class V(c.Sized, S):
def __len__(self):
return 0