Merge "Avoid swallowing AssertionError in test skipping logic"
This commit is contained in:
commit
2a86c41b72
@ -1470,12 +1470,13 @@ class TestSelectableAggregates(FunctionalTest,
|
|||||||
def test_bad_selectable_parameterized_aggregate(self):
|
def test_bad_selectable_parameterized_aggregate(self):
|
||||||
agg_args = {'aggregate.func': 'cardinality',
|
agg_args = {'aggregate.func': 'cardinality',
|
||||||
'aggregate.param': 'injection_attack'}
|
'aggregate.param': 'injection_attack'}
|
||||||
resp = self.get_json(self.PATH, expect_errors=True,
|
resp = self.get_json(self.PATH, status=[400],
|
||||||
groupby=['project_id'], **agg_args)
|
groupby=['project_id'], **agg_args)
|
||||||
self.assertTrue(400, resp.status_code)
|
self.assertTrue('error_message' in resp)
|
||||||
self.assertTrue('error_message' in resp.json)
|
self.assertEqual(resp['error_message'].get('faultcode'),
|
||||||
self.assertEqual('Bad aggregate: cardinality.injection_attack',
|
'Client')
|
||||||
resp.json['error_message'].get('faultstring'))
|
self.assertEqual(resp['error_message'].get('faultstring'),
|
||||||
|
'Bad aggregate: cardinality.injection_attack')
|
||||||
|
|
||||||
|
|
||||||
class TestUnparameterizedAggregates(FunctionalTest,
|
class TestUnparameterizedAggregates(FunctionalTest,
|
||||||
|
@ -59,6 +59,8 @@ def _skip_decorator(func):
|
|||||||
def skip_if_not_implemented(*args, **kwargs):
|
def skip_if_not_implemented(*args, **kwargs):
|
||||||
try:
|
try:
|
||||||
return func(*args, **kwargs)
|
return func(*args, **kwargs)
|
||||||
|
except AssertionError:
|
||||||
|
raise
|
||||||
except NotImplementedError as e:
|
except NotImplementedError as e:
|
||||||
raise testcase.TestSkipped(six.text_type(e))
|
raise testcase.TestSkipped(six.text_type(e))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user