Skip to content
Snippets Groups Projects
Commit 7e36d447 authored by Derval Guillaume's avatar Derval Guillaume
Browse files

Fix tests

parent f3591046
No related branches found
No related tags found
No related merge requests found
Pipeline #10541 failed
import unittest import unittest
from pathlib import Path from pathlib import Path
from lark.exceptions import UnexpectedCharacters, UnexpectedToken
from gboml.ast.check import check from gboml.ast.check import check
from gboml.parsing import parse_file from gboml.parsing import parse_file
...@@ -25,13 +27,18 @@ class TestParsing(unittest.TestCase): ...@@ -25,13 +27,18 @@ class TestParsing(unittest.TestCase):
""" Checks if the file (doesn't) parses """ """ Checks if the file (doesn't) parses """
for filename in should_pass: for filename in should_pass:
with self.subTest(filename=filename): with self.subTest(filename=filename):
check(parse_file(str(filename))) out = parse_file(str(filename))
check(out)
@unittest.expectedFailure
def test_not_parse(self): def test_not_parse(self):
for filename in should_not_pass: for filename in should_not_pass:
with self.subTest(filename=filename): 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__': if __name__ == '__main__':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment