Skip to content

Commit

Permalink
use super.iter_errors for fast, check warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
bollwyvl committed Mar 30, 2022
1 parent 46d99e2 commit ded36a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nbformat/json_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion tests/test_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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():
Expand Down

0 comments on commit ded36a5

Please sign in to comment.