@@ -248,8 +248,9 @@ def test_create_requires_cidr_or_virsubnet(self):
248248
249249 parsed_args = self .check_parser (self .cmd , arglist , verifylist )
250250
251- with self .assertRaises (exceptions .CommandError ):
252- self .cmd .take_action (parsed_args )
251+ self .assertRaises (
252+ exceptions .CommandError , self .cmd .take_action , parsed_args
253+ )
253254
254255 def test_create_both_cidr_and_virsubnet (self ):
255256 arglist = [
@@ -271,8 +272,9 @@ def test_create_both_cidr_and_virsubnet(self):
271272
272273 parsed_args = self .check_parser (self .cmd , arglist , verifylist )
273274
274- with self .assertRaises (exceptions .CommandError ):
275- self .cmd .take_action (parsed_args )
275+ self .assertRaises (
276+ exceptions .CommandError , self .cmd .take_action , parsed_args
277+ )
276278
277279 def test_create_more_than_20_transit_ip_ids (self ):
278280 arglist = [
@@ -293,8 +295,9 @@ def test_create_more_than_20_transit_ip_ids(self):
293295
294296 parsed_args = self .check_parser (self .cmd , arglist , verifylist )
295297
296- with self .assertRaises (exceptions .CommandError ):
297- self .cmd .take_action (parsed_args )
298+ self .assertRaises (
299+ exceptions .CommandError , self .cmd .take_action , parsed_args
300+ )
298301
299302
300303class TestUpdatePrivateSnatRule (fakes .TestPrivateNat ):
0 commit comments