diff options
| author | natsuoto <[email protected]> | 2026-07-10 16:18:09 +0530 |
|---|---|---|
| committer | natsuoto <[email protected]> | 2026-07-10 16:18:09 +0530 |
| commit | 9d80c99432c0c7c5f184cbe7bb25513aace01a7e (patch) | |
| tree | ec79c1768bf35c10ce9f708d0ee77a18eb746d80 /tests/errors/quantifier.test.py | |
| parent | c757ea1fea447df3ed69e74b407ca9710a9f85e0 (diff) | |
| download | edify-9d80c99432c0c7c5f184cbe7bb25513aace01a7e.tar.xz edify-9d80c99432c0c7c5f184cbe7bb25513aace01a7e.zip | |
feat(errors): annotated error messages with caller-context pointers
Diffstat (limited to 'tests/errors/quantifier.test.py')
| -rw-r--r-- | tests/errors/quantifier.test.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/errors/quantifier.test.py b/tests/errors/quantifier.test.py index 27b5ddf..1256a68 100644 --- a/tests/errors/quantifier.test.py +++ b/tests/errors/quantifier.test.py @@ -42,14 +42,15 @@ def test_to_regex_raises_when_a_bare_quantifier_has_no_operand(): def test_dangling_message_hints_at_appending_an_operand(): - with pytest.raises(DanglingQuantifierError, match="Append an element"): + with pytest.raises(DanglingQuantifierError, match="append the element"): RegexBuilder().exactly(3).to_regex_string() def test_dangling_quantifier_error_message_contains_expected_text(): error = DanglingQuantifierError() - assert "Dangling quantifier" in str(error) - assert "no operand" in str(error) + text = str(error) + assert "dangling quantifier" in text + assert "no operand" in text def test_stacking_one_or_more_over_exactly_raises(): @@ -84,5 +85,6 @@ def test_a_valid_quantifier_element_quantifier_element_chain_works(): def test_stacked_quantifier_error_message_contains_expected_text(): error = StackedQuantifierError() - assert "stack" in str(error) - assert "pending" in str(error) + text = str(error) + assert "stack a quantifier" in text + assert "pending quantifier" in text |
