summaryrefslogtreecommitdiff
path: root/_test/test_cyaml.py
diff options
context:
space:
mode:
Diffstat (limited to '_test/test_cyaml.py')
-rw-r--r--_test/test_cyaml.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/_test/test_cyaml.py b/_test/test_cyaml.py
index 4c5c5db..2d67509 100644
--- a/_test/test_cyaml.py
+++ b/_test/test_cyaml.py
@@ -4,18 +4,26 @@ import platform
import pytest
-@pytest.mark.skipif(platform.python_implementation() == 'Jython',
- reason="Jython throws RepresenterError")
+@pytest.mark.skipif(
+ platform.python_implementation() == 'Jython', reason='Jython throws RepresenterError'
+)
def test_load_cyaml():
import ruamel.yaml
+
assert ruamel.yaml.__with_libyaml__
from ruamel.yaml.cyaml import CLoader
- ruamel.yaml.load("abc: 1", Loader=CLoader)
+
+ ruamel.yaml.load('abc: 1', Loader=CLoader)
def test_dump_cyaml():
import ruamel.yaml
+
data = {'a': 1, 'b': 2}
- res = ruamel.yaml.dump(data, Dumper=ruamel.yaml.cyaml.CSafeDumper,
- default_flow_style=False, allow_unicode=True)
- assert res == "a: 1\nb: 2\n"
+ res = ruamel.yaml.dump(
+ data,
+ Dumper=ruamel.yaml.cyaml.CSafeDumper,
+ default_flow_style=False,
+ allow_unicode=True,
+ )
+ assert res == 'a: 1\nb: 2\n'