summaryrefslogtreecommitdiff
path: root/_test
diff options
context:
space:
mode:
authorsixolet <naomi@seyfer.org>2018-09-05 16:19:17 -0700
committersixolet <naomi@seyfer.org>2018-09-05 16:19:17 -0700
commitc93735f860031c38616acbff83ce7ce55f30f40f (patch)
tree6b8d7564143815720f03207f3449fad37d8c8d68 /_test
parent79195ab05d3f1c4513e8bdd29ad0327612f1ffb5 (diff)
downloadruamel.yaml-c93735f860031c38616acbff83ce7ce55f30f40f.tar.gz
Change an unmatched closing bracket from an IndexError to a ScannerError.
Since it's a problem with the user's document, it should be some kind of YAMLError at least.
Diffstat (limited to '_test')
-rw-r--r--_test/test_issues.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/_test/test_issues.py b/_test/test_issues.py
index 62c1d92..171eb2b 100644
--- a/_test/test_issues.py
+++ b/_test/test_issues.py
@@ -380,3 +380,15 @@ class TestIssues:
yaml = ruamel.yaml.YAML(typ='safe')
yaml.load('phone: 0123456789')
+
+ def test_issue_232(self):
+ import ruamel.yaml
+ from ruamel import yaml
+ with pytest.raises(ruamel.yaml.scanner.ScannerError, match='unmatched'):
+ yaml.safe_load(']')
+ with pytest.raises(ruamel.yaml.scanner.ScannerError, match='unmatched'):
+ yaml.load(']')
+ with pytest.raises(ruamel.yaml.scanner.ScannerError, match='expected'):
+ yaml.safe_load('{]')
+ with pytest.raises(ruamel.yaml.scanner.ScannerError, match='expected'):
+ yaml.load('{]')