diff options
author | Anthon van der Neut <anthon@mnt.org> | 2018-10-06 19:34:28 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2018-10-06 19:34:28 +0200 |
commit | ffaab93d8964e7fbcbc2efe3399ae128fb4c5756 (patch) | |
tree | 3f76d9322d1edfc8ca66e4bbe98cfed8c3cf7a11 /_test | |
parent | 334c992703b2093a26b59d2cac403375b568c617 (diff) | |
download | ruamel.yaml-ffaab93d8964e7fbcbc2efe3399ae128fb4c5756.tar.gz |
fix issue #245 regression on C parsing of explicit 1.1 source0.15.72
*When this change indeed resolves your problem, please **Close** this issue*.
*(You can do so using the WorkFlow pull-down (close to the top right of this page))*
Diffstat (limited to '_test')
-rw-r--r-- | _test/roundtrip.py | 4 | ||||
-rw-r--r-- | _test/test_issues.py | 1 | ||||
-rw-r--r-- | _test/test_z_data.py | 8 |
3 files changed, 9 insertions, 4 deletions
diff --git a/_test/roundtrip.py b/_test/roundtrip.py index 8e1e66e..ee430a3 100644 --- a/_test/roundtrip.py +++ b/_test/roundtrip.py @@ -251,6 +251,10 @@ def save_and_run(program, base_dir=None, output=None, file_name=None, optimized= print('running:', *cmd) res = check_output(cmd, stderr=STDOUT, universal_newlines=True) if output is not None: + if '__pypy__' in sys.builtin_module_names: + res = res.splitlines(True) + res = [line for line in res if 'no version info' not in line] + res = ''.join(res) print('result: ', res, end='') print('expected:', output, end='') assert res == output diff --git a/_test/test_issues.py b/_test/test_issues.py index 4ccbff4..51cd5f7 100644 --- a/_test/test_issues.py +++ b/_test/test_issues.py @@ -514,7 +514,6 @@ class TestIssues: d0 = CommentedMap([('a', 'b')]) assert d0['a'] == 'b' - @pytest.mark.xfail(strict=True, reason='regression on Yes', raises=AssertionError) def test_issue_xxx(self): from ruamel.yaml import YAML inp = """ diff --git a/_test/test_z_data.py b/_test/test_z_data.py index 35c1ded..d106a2a 100644 --- a/_test/test_z_data.py +++ b/_test/test_z_data.py @@ -54,9 +54,11 @@ class YAMLData(object): return cls(constructor.construct_mapping(node)) return cls(node.value) + class Python(YAMLData): yaml_tag = '!Python' + class Output(YAMLData): yaml_tag = '!Output' @@ -144,7 +146,7 @@ class TestYAMLData(object): assert save_and_run(python.value, base_dir=tmpdir, output=data.value) == 0 - # this is executed by pytest the methods with names not starting with test_ + # this is executed by pytest the methods with names not starting with test_ # are helpers def test_yaml_data(self, yaml, tmpdir): from ruamel.yaml.compat import Mapping @@ -168,7 +170,7 @@ class TestYAMLData(object): elif isinstance(doc, Python): python = doc if typ is None: - typ = 'pyrun' + typ = 'python_run' elif isinstance(doc, YAMLData): data = doc else: @@ -187,7 +189,7 @@ class TestYAMLData(object): print('output:', output.value if output is not None else output) if typ == 'rt': self.round_trip(data, output, yaml_version=yaml_version) - elif typ == 'pyrun': + elif typ == 'python_run': self.run_python(python, output if output is not None else data, tmpdir) elif typ == 'load_assert': self.load_assert(data, confirm, yaml_version=yaml_version) |