[pypy-commit] pypy py3.5: Prevent test from crashing for an unrelated reason

rlamy pypy.commits at gmail.com
Wed Nov 22 17:46:29 EST 2017


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: py3.5
Changeset: r93125:9a354884fd09
Date: 2017-11-22 22:46 +0000
http://bitbucket.org/pypy/pypy/changeset/9a354884fd09/

Log:	Prevent test from crashing for an unrelated reason

diff --git a/lib-python/3/test/test_descr.py b/lib-python/3/test/test_descr.py
--- a/lib-python/3/test/test_descr.py
+++ b/lib-python/3/test/test_descr.py
@@ -4278,7 +4278,10 @@
         c = C()
         c.__dict__[Evil()] = 0
 
-        self.assertEqual(c.attr, 1)
+        try:
+            self.assertEqual(c.attr, 1)
+        except AttributeError:  # when Evil.__eq__ is called twice
+            pass
         # this makes a crash more likely:
         support.gc_collect()
         self.assertNotHasAttr(c, 'attr')


More information about the pypy-commit mailing list