Skip to content

Commit 3e4c168

Browse files
committed
Make yaml source test optional
1 parent 62c57cc commit 3e4c168

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tests/test_source.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
from unittest import mock
1010

1111
import pytest
12-
from ruamel import yaml
12+
try:
13+
from ruamel import yaml
14+
except ImportError:
15+
yaml = None
1316

1417
from structa.analyzer import ValidationWarning
1518
from structa.source import Source
@@ -144,6 +147,7 @@ def test_source_json_data(tmpdir, table):
144147
assert s.data == table
145148

146149

150+
@pytest.mark.skipif(yaml is None, reason="Requires ruamel.yaml")
147151
def test_source_yaml_data(tmpdir, table):
148152
data_file = str(tmpdir.join('data.yaml'))
149153
with open(data_file, 'w', encoding='utf-8') as f:

0 commit comments

Comments
 (0)