diff --git a/nbformat/json_compat.py b/nbformat/json_compat.py index 631e7182..9e472941 100644 --- a/nbformat/json_compat.py +++ b/nbformat/json_compat.py @@ -58,7 +58,7 @@ def validate(self, data): def iter_errors(self, data, schema=None): if schema is not None: - return self._default_validator.iter_errors(data, schema) + return super().iter_errors(data, schema) errors = [] validate_func = self._validator diff --git a/tests/test_validator.py b/tests/test_validator.py index 46804a21..34ad06c9 100644 --- a/tests/test_validator.py +++ b/tests/test_validator.py @@ -201,7 +201,7 @@ def test_invalid_validator_raises_value_error_after_read(): validate(nb) -def test_fallback_validator_with_iter_errors_using_ref(): +def test_fallback_validator_with_iter_errors_using_ref(recwarn): """ Test that when creating a standalone object (code_cell etc) the default validator is used as fallback. @@ -211,6 +211,8 @@ def test_fallback_validator_with_iter_errors_using_ref(): nbformat.v4.new_code_cell() nbformat.v4.new_markdown_cell() nbformat.v4.new_raw_cell() + assert len(recwarn) == 0 + def test_non_unique_cell_ids():