Skip to content

Commit

Permalink
Use assertRaises in a backward compatible fashion
Browse files Browse the repository at this point in the history
  • Loading branch information
shin- committed Mar 25, 2015
1 parent 6e0b5a8 commit 2f6579b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2285,8 +2285,10 @@ def test_create_host_config_secopt(self):
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):
Expand Down

0 comments on commit 2f6579b

Please sign in to comment.