summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoffrey F <joffrey@docker.com>2015-03-25 16:07:16 -0700
committerJoffrey F <joffrey@docker.com>2015-03-25 16:07:16 -0700
commit2f6579bf59b9e53a9c903ddd6d47a885c41fa307 (patch)
tree59c359c3661a768db444696e56271cac28789b12
parent6e0b5a8d700562d1991c73b49fc30ebd81983c45 (diff)
downloaddocker-py-2f6579bf59b9e53a9c903ddd6d47a885c41fa307.tar.gz
Use assertRaises in a backward compatible fashion
-rw-r--r--tests/test.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test.py b/tests/test.py
index 2661a45..303f65b 100644
--- a/tests/test.py
+++ b/tests/test.py
@@ -2285,8 +2285,10 @@ class DockerClientTest(Cleanup, unittest.TestCase):
self.assertIn('SecurityOpt', result)
self.assertEqual(result['SecurityOpt'], security_opt)
- with self.assertRaises(docker.errors.DockerException):
- create_host_config(security_opt='wrong')
+ self.assertRaises(
+ docker.errors.DockerException, create_host_config,
+ security_opt='wrong'
+ )
class StreamTest(Cleanup, unittest.TestCase):