summaryrefslogtreecommitdiff
path: root/_test/lib/test_structure.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2023-05-01 19:13:50 +0200
committerAnthon van der Neut <anthon@mnt.org>2023-05-01 19:13:50 +0200
commit8b731994b1543d7886af85f926d9eea5a22d0732 (patch)
tree3553d4cbc80b541484d7a3f39e00cdcfd8f9d030 /_test/lib/test_structure.py
parent45111ba0b67e8619265d89f3202635e62c13cde6 (diff)
downloadruamel.yaml-8b731994b1543d7886af85f926d9eea5a22d0732.tar.gz
retrofitted 0.18 changes
Diffstat (limited to '_test/lib/test_structure.py')
-rw-r--r--_test/lib/test_structure.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/_test/lib/test_structure.py b/_test/lib/test_structure.py
index 470d267..8de24a3 100644
--- a/_test/lib/test_structure.py
+++ b/_test/lib/test_structure.py
@@ -84,9 +84,9 @@ def test_parser(data_filename, canonical_filename, verbose=False):
events2 = None
try:
with open(data_filename, 'rb') as fp0:
- events1 = list(ruamel.yaml.parse(fp0))
+ events1 = list(ruamel.yaml.YAML().parse(fp0))
with open(canonical_filename, 'rb') as fp0:
- events2 = list(ruamel.yaml.canonical_parse(fp0))
+ events2 = list(ruamel.yaml.YAML().canonical_parse(fp0))
_compare_events(events1, events2)
finally:
if verbose:
@@ -104,9 +104,9 @@ def test_parser_on_canonical(canonical_filename, verbose=False):
events2 = None
try:
with open(canonical_filename, 'rb') as fp0:
- events1 = list(ruamel.yaml.parse(fp0))
+ events1 = list(ruamel.yaml.YAML().parse(fp0))
with open(canonical_filename, 'rb') as fp0:
- events2 = list(ruamel.yaml.canonical_parse(fp0))
+ events2 = list(ruamel.yaml.YAML().canonical_parse(fp0))
_compare_events(events1, events2, full=True)
finally:
if verbose:
@@ -138,10 +138,11 @@ def test_composer(data_filename, canonical_filename, verbose=False):
nodes1 = None
nodes2 = None
try:
+ yaml = ruamel.yaml.YAML()
with open(data_filename, 'rb') as fp0:
- nodes1 = list(ruamel.yaml.compose_all(fp0))
+ nodes1 = list(yaml.compose_all(fp0))
with open(canonical_filename, 'rb') as fp0:
- nodes2 = list(ruamel.yaml.canonical_compose_all(fp0))
+ nodes2 = list(yaml.canonical_compose_all(fp0))
assert len(nodes1) == len(nodes2), (len(nodes1), len(nodes2))
for node1, node2 in zip(nodes1, nodes2):
_compare_nodes(node1, node2)