diff options
Diffstat (limited to '_test')
-rw-r--r-- | _test/test_issues.py | 10 | ||||
-rw-r--r-- | _test/test_z_data.py | 4 |
2 files changed, 12 insertions, 2 deletions
diff --git a/_test/test_issues.py b/_test/test_issues.py index 0d1a43d..5007f60 100644 --- a/_test/test_issues.py +++ b/_test/test_issues.py @@ -603,6 +603,16 @@ class TestIssues: with pytest.raises(RepresenterError, match='cannot represent'): yaml.dump({'t': t}, stdout) + def test_issue_282(self): + # update from list of tuples caused AttributeError + import ruamel.yaml + yaml_data = ruamel.yaml.comments.CommentedMap([('a', 'apple'), ('b', 'banana')]) + yaml_data.update([('c', 'cantaloupe')]) + yaml_data.update({'d': 'date', 'k': 'kiwi'}) + assert 'c' in yaml_data.keys() + assert 'c' in yaml_data._ok + + # @pytest.mark.xfail(strict=True, reason='bla bla', raises=AssertionError) # def test_issue_ xxx(self): # inp = """ diff --git a/_test/test_z_data.py b/_test/test_z_data.py index f4e47cf..fcd09be 100644 --- a/_test/test_z_data.py +++ b/_test/test_z_data.py @@ -186,7 +186,7 @@ class TestYAMLData(object): data = doc else: print('no handler for type:', type(doc), repr(doc)) - assert False + raise AssertionError() if typ is None: if data is not None and output is not None: typ = 'rt' @@ -207,7 +207,7 @@ class TestYAMLData(object): self.load_assert(data, confirm, yaml_version=yaml_version) else: print('\nrun type unknown:', typ) - assert False + raise AssertionError() def check_python_version(match, current=None): |