diff --git a/plugins/sub_plugins/validate/jsonschema.py b/plugins/sub_plugins/validate/jsonschema.py index 6d55ec72..388cdf2b 100644 --- a/plugins/sub_plugins/validate/jsonschema.py +++ b/plugins/sub_plugins/validate/jsonschema.py @@ -282,7 +282,11 @@ def _validate_jsonschema(self): suppress_fields = [] if suppress_output: - suppress_fields = suppress_output if isinstance(suppress_output, list) else ["found", "relative_schema"] + suppress_fields = ( + suppress_output + if isinstance(suppress_output, list) + else ["found", "relative_schema"] + ) for validation_error in validation_errors: if isinstance(validation_error, jsonschema.ValidationError): diff --git a/tests/unit/plugins/action/test_validate.py b/tests/unit/plugins/action/test_validate.py index 2305c7fb..badfc1d4 100644 --- a/tests/unit/plugins/action/test_validate.py +++ b/tests/unit/plugins/action/test_validate.py @@ -335,6 +335,8 @@ def test_suppress_output_is_a_list(self): "suppress_output": ["relative_schema"], } - result = self._plugin.run(task_vars=dict(ansible_validate_jsonschema_suppress_output=['relative_schema'])) + result = self._plugin.run( + task_vars=dict(ansible_validate_jsonschema_suppress_output=["relative_schema"]) + ) self.assertIn("found", result) self.assertNotIn("relative_schema", result)