diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-04-18 21:03:10 +0000 |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-04-18 21:03:10 +0000 |
commit | accb3d0014cf4b4bebf3ae8f5a1c73e099c470f7 (patch) | |
tree | e2187c5d6ac8865678126c83bc69a34023bb72b9 | |
parent | 5ce73759bf9d3d84e1270ea08b8de55b57e3278b (diff) | |
download | cpython-git-accb3d0014cf4b4bebf3ae8f5a1c73e099c470f7.tar.gz |
move test to a more appropiate one
-rw-r--r-- | Lib/test/test_descr.py | 55 |
1 files changed, 30 insertions, 25 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index b5c767c6bf..05b4486b67 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -3811,31 +3811,6 @@ order (MRO) for bases """ self.assertEqual(e.a, 2) self.assertEqual(C2.__subclasses__(), [D]) - # stuff that shouldn't: - class L(list): - pass - - try: - L.__bases__ = (dict,) - except TypeError: - pass - else: - self.fail("shouldn't turn list subclass into dict subclass") - - try: - list.__bases__ = (dict,) - except TypeError: - pass - else: - self.fail("shouldn't be able to assign to list.__bases__") - - try: - D.__bases__ = (C2, list) - except TypeError: - pass - else: - assert 0, "best_base calculation found wanting" - try: del D.__bases__ except (TypeError, AttributeError): @@ -3906,6 +3881,36 @@ order (MRO) for bases """ if tp is not object: self.assertEqual(len(tp.__bases__), 1, tp) + class L(list): + pass + + class C(object): + pass + + class D(C): + pass + + try: + L.__bases__ = (dict,) + except TypeError: + pass + else: + self.fail("shouldn't turn list subclass into dict subclass") + + try: + list.__bases__ = (dict,) + except TypeError: + pass + else: + self.fail("shouldn't be able to assign to list.__bases__") + + try: + D.__bases__ = (C, list) + except TypeError: + pass + else: + assert 0, "best_base calculation found wanting" + def test_mutable_bases_with_failing_mro(self): # Testing mutable bases with failing mro... |