diff options
Diffstat (limited to '_test')
-rw-r--r-- | _test/test_issues.py | 14 | ||||
-rw-r--r-- | _test/test_z_data.py | 4 |
2 files changed, 16 insertions, 2 deletions
diff --git a/_test/test_issues.py b/_test/test_issues.py index 721f3fe..d5913f6 100644 --- a/_test/test_issues.py +++ b/_test/test_issues.py @@ -560,8 +560,22 @@ class TestIssues: """ d = round_trip(inp) # NOQA + def test_issue_280(self): + from ruamel.yaml import YAML + from ruamel.yaml.representer import RepresenterError + from collections import namedtuple + from sys import stdout + T = namedtuple('T', ('a', 'b')) + t = T(1, 2) + yaml = YAML() + with pytest.raises(RepresenterError, match='cannot represent'): + yaml.dump({'t': t}, stdout) + # @pytest.mark.xfail(strict=True, reason='bla bla', raises=AssertionError) # def test_issue_ xxx(self): # inp = """ # """ # d = round_trip(inp) # NOQA + + + diff --git a/_test/test_z_data.py b/_test/test_z_data.py index 99810aa..f4e47cf 100644 --- a/_test/test_z_data.py +++ b/_test/test_z_data.py @@ -170,7 +170,7 @@ class TestYAMLData(object): yaml_version = d.get('yaml_version') if 'python' in d: if not check_python_version(d['python']): - pytest.skip("unsupported version") + pytest.skip('unsupported version') idx += 1 data = output = confirm = python = None for doc in docs[idx:]: @@ -230,7 +230,7 @@ def check_python_version(match, current=None): # assert m[0].isdigit() # assert m[-1].isdigit() m = [int(x) for x in m.split('.')] - current_len = current[:len(m)] + current_len = current[: len(m)] # print(m, current, current_len) if minimal: if current_len >= m: |