Skip to content
Snippets Groups Projects
Unverified Commit b55f97fd authored by Sebastian Höffner's avatar Sebastian Höffner
Browse files

Updated ccgparser test to catch file readings errors per subTest and not for all files at once.

parent f68becbe
No related branches found
No related tags found
No related merge requests found
......@@ -13,18 +13,18 @@ import ccgparser # noqa
class CCGtoJSONTestCase(unittest.TestCase):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.maxDiff = None
def test_ccg_to_json(self):
"""
Provides some example OpenCCG outputs and the expected JSON parses.
"""
self.test_files = (Path(os.path.dirname(__file__))
/ 'test_files'
/ 'ccg_to_json').glob('*')
for name, test_case in [(tf.name, json.loads(tf.read_text()))
for tf in self.test_files]:
with self.subTest(test_case=name):
test_files = (Path(os.path.dirname(__file__)) / 'test_files' / 'ccg_to_json').glob('*')
for tf in test_files:
with self.subTest(test_case=tf.name):
test_case = json.loads(tf.read_text())
ccg = test_case['ccg']
expected = test_case['json']
......
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