Skip to content

Commit eee5504

Browse files
Scott Sandersonrgbkrk
authored andcommitted
BUG: assertRaises isn't a contextmanager on 2.6.
1 parent 10491eb commit eee5504

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tests/cloudpickle_test.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -619,10 +619,8 @@ def foo(self):
619619
self.assertEqual(depickled_class().foo(), 'it works!')
620620
self.assertEqual(depickled_instance.foo(), 'it works!')
621621

622-
# It should still be invalid to construct an instance of the abstract
623-
# class without implementing its methods.
624-
with self.assertRaises(TypeError):
625-
depickled_base()
622+
# assertRaises doesn't return a contextmanager in python 2.6 :(.
623+
self.failUnlessRaises(TypeError, depickled_base)
626624

627625
class DepickledBaseSubclass(depickled_base):
628626
def foo(self):

0 commit comments

Comments
 (0)