summaryrefslogtreecommitdiff
path: root/_test/test_issues.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2019-02-27 22:23:14 +0100
committerAnthon van der Neut <anthon@mnt.org>2019-02-27 22:23:14 +0100
commit17af0e7a084955b5c0bf4124bba87190ac16734d (patch)
tree99a390343fd3cc141278c5768e9cbfd15778ebba /_test/test_issues.py
parent1fa26ba7438db4edcd6f7748dd7cf2ec3a00c241 (diff)
downloadruamel.yaml-17af0e7a084955b5c0bf4124bba87190ac16734d.tar.gz
fix issue #280 namedtuple erorring in error generation on safe_dump
*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/test_issues.py')
-rw-r--r--_test/test_issues.py14
1 files changed, 14 insertions, 0 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
+
+
+