From 7e36d447bc423925e99d7a8de175ddf61ddffea6 Mon Sep 17 00:00:00 2001 From: Derval Guillaume <gderval@uliege.be> Date: Wed, 30 Nov 2022 23:44:54 +0100 Subject: [PATCH] Fix tests --- tests/test_parsing.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/test_parsing.py b/tests/test_parsing.py index 1439faa..a961f6c 100644 --- a/tests/test_parsing.py +++ b/tests/test_parsing.py @@ -1,6 +1,8 @@ import unittest from pathlib import Path +from lark.exceptions import UnexpectedCharacters, UnexpectedToken + from gboml.ast.check import check from gboml.parsing import parse_file @@ -25,13 +27,18 @@ class TestParsing(unittest.TestCase): """ Checks if the file (doesn't) parses """ for filename in should_pass: with self.subTest(filename=filename): - check(parse_file(str(filename))) + out = parse_file(str(filename)) + check(out) - @unittest.expectedFailure def test_not_parse(self): for filename in should_not_pass: with self.subTest(filename=filename): - parse_file(str(filename)) + try: + out = parse_file(str(filename)) + check(out) + except: + continue + raise Exception("Shouldn't success") if __name__ == '__main__': -- GitLab