Skip to content

Commit

Permalink
catch pypy differing error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
cleder committed Oct 28, 2023
1 parent 26769f5 commit e5e9e04
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@ def test_get_bounds() -> None:
),
# Edge cases
(("", "value"), AttributeError, "Attributes of _Geometry cannot be changed"),
((None, "value"), TypeError, "attribute name must be string, not 'NoneType'"),
((None, "value"), TypeError, ".*attribute name must be string.*"),
# Error cases
((123, "value"), TypeError, "attribute name must be string, not 'int'"),
(([1, 2, 3], "value"), TypeError, "attribute name must be string, not 'list'"),
((123, "value"), TypeError, ".*attribute name must be string.*"),
(([1, 2, 3], "value"), TypeError, ".*attribute name must be string.*"),
],
)
def test_setattr(attr_val, expected_error, expected_error_message) -> None:
Expand All @@ -124,12 +124,12 @@ def test_setattr(attr_val, expected_error, expected_error_message) -> None:
(
None,
TypeError,
"attribute name must be string, not 'NoneType'",
".*attribute name must be string.*",
), # edge case: None
(
123,
TypeError,
"attribute name must be string, not 'int'",
".*attribute name must be string.*",
), # error case: non-string attribute
],
ids=[
Expand Down

0 comments on commit e5e9e04

Please sign in to comment.