Simplify error & warning handling

This commit is contained in:
James Westman 2022-12-25 17:10:21 -06:00
parent 122b049ce9
commit b6ee649458
No known key found for this signature in database
GPG key ID: CE2DBA0ADB654EA6
8 changed files with 38 additions and 21 deletions

View file

@ -57,8 +57,6 @@ class TestSamples(unittest.TestCase):
if errors:
raise errors
if len(ast.errors):
raise MultipleErrors(ast.errors)
if len(warnings):
raise MultipleErrors(warnings)
@ -94,8 +92,9 @@ class TestSamples(unittest.TestCase):
tokens = tokenizer.tokenize(blueprint)
ast, errors, warnings = parser.parse(tokens)
self.assert_docs_dont_crash(blueprint, ast)
self.assert_completions_dont_crash(blueprint, ast, tokens)
if ast is not None:
self.assert_docs_dont_crash(blueprint, ast)
self.assert_completions_dont_crash(blueprint, ast, tokens)
if errors:
raise errors