diff options
Diffstat (limited to 'tests/pattern')
| -rw-r--r-- | tests/pattern/classes.test.py | 6 | ||||
| -rw-r--r-- | tests/pattern/composition.test.py | 8 | ||||
| -rw-r--r-- | tests/pattern/factories/values.test.py | 6 |
3 files changed, 3 insertions, 17 deletions
diff --git a/tests/pattern/classes.test.py b/tests/pattern/classes.test.py index 8a82353..c5d4f63 100644 --- a/tests/pattern/classes.test.py +++ b/tests/pattern/classes.test.py @@ -42,7 +42,7 @@ from edify import ( (ALPHANUMERIC, "[a-zA-Z0-9]"), ], ) -def test_character_class_constant_compiles_to_expected_regex(constant, expected): +def test_character_class_constant_compiles_to_expected_regex(constant: Pattern, expected: str): assert constant.to_regex_string() == expected @@ -66,7 +66,7 @@ def test_character_class_constant_compiles_to_expected_regex(constant, expected) ALPHANUMERIC, ], ) -def test_character_class_constant_is_a_pattern(constant): +def test_character_class_constant_is_a_pattern(constant: object): assert isinstance(constant, Pattern) @@ -82,7 +82,7 @@ def test_character_class_constant_is_a_pattern(constant): ], ) def test_convenience_char_class_constant_matches_expected_characters( - constant, hit_input, miss_input + constant: Pattern, hit_input: str, miss_input: str ): assert constant.test(hit_input) is True assert constant.test(miss_input) is False diff --git a/tests/pattern/composition.test.py b/tests/pattern/composition.test.py index 34d6f89..8242e0e 100644 --- a/tests/pattern/composition.test.py +++ b/tests/pattern/composition.test.py @@ -1,9 +1,6 @@ """Tests for the :class:`Pattern` composition surface.""" -import pytest - from edify import Pattern, RegexBuilder -from edify.errors.input import MustBeInstanceError def test_pattern_builds_the_same_element_tree_as_a_builder(): @@ -34,8 +31,3 @@ def test_subexpression_still_accepts_a_pattern(): pattern = Pattern().at_least(3).word() embedded = RegexBuilder().subexpression(pattern) assert embedded.to_regex_string() == "\\w{3,}" - - -def test_subexpression_rejects_non_builder_input(): - with pytest.raises(MustBeInstanceError): - RegexBuilder().subexpression("not a pattern") diff --git a/tests/pattern/factories/values.test.py b/tests/pattern/factories/values.test.py index 69b04b7..8aa28b4 100644 --- a/tests/pattern/factories/values.test.py +++ b/tests/pattern/factories/values.test.py @@ -4,7 +4,6 @@ import pytest from edify import Pattern, char, chars, nonchars, nonrange, nonstring, range_of, string from edify.errors.input import ( - MustBeAStringError, MustBeOneCharacterError, MustBeSingleCharacterError, MustHaveASmallerValueError, @@ -60,8 +59,3 @@ def test_nonrange_produces_a_negated_character_range(): def test_string_rejects_empty_input(): with pytest.raises(MustBeOneCharacterError): string("") - - -def test_string_rejects_non_string_input(): - with pytest.raises(MustBeAStringError): - string(42) |
