Skip to content

Commit

Permalink
Merge pull request #61 from iolanta-tech/57-tc037
Browse files Browse the repository at this point in the history
#57 Skip an Expand test if it fails on pyld
  • Loading branch information
anatoly-scherbakov authored Apr 24, 2024
2 parents 4bab539 + 1b27240 commit c0109a3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/test_specification.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import json
import operator
from pathlib import Path

import pytest
from pyld import jsonld
from rdflib import Graph, Namespace
from rdflib_pyld_compat.convert import ( # noqa: WPS450
_rdflib_graph_from_pyld_dataset,
Expand Down Expand Up @@ -89,6 +91,15 @@ def test_expand(test_case: TestCase):
test_case.input,
extract_all_scripts=test_case.extract_all_scripts,
)
assert actual == expected
if actual != expected:
# Try running `pyld` against this example.
jsonld_actual = jsonld.expand(json.loads(test_case.result.read_text()))

if jsonld_actual == expected:
# PyLD is fine. We're having a trouble with YAML-LD.
assert actual == expected

pytest.skip('PyLD fails on this test, skipping it.')

else:
raise ValueError(f'What to do with this test? {test_case}')

0 comments on commit c0109a3

Please sign in to comment.