diff options
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_descr.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index c7989b1136..627f8aa097 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -1689,6 +1689,7 @@ order (MRO) for bases """ return isinstance(int, obj) def do_issubclass(obj): return issubclass(int, obj) + def swallow(*args): pass # It would be nice to have every special method tested here, but I'm # only listing the ones I can remember outside of typeobject.c, since it @@ -1702,11 +1703,8 @@ order (MRO) for bases """ ("__instancecheck__", do_isinstance, return_true, set(), {}), ("__subclasscheck__", do_issubclass, return_true, set(("__bases__",)), {}), - # These two fail because the compiler generates LOAD_ATTR to look - # them up. We'd have to add a new opcode to fix this, and it's - # probably not worth it. - # ("__enter__", run_context, iden), - # ("__exit__", run_context, iden), + ("__enter__", run_context, iden, set(), {"__exit__" : swallow}), + ("__exit__", run_context, swallow, set(), {"__enter__" : iden}), ] class Checker(object): |