Skip to content

Commit

Permalink
Change error messages for Python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Jeffery committed Oct 5, 2022
1 parent 1919abe commit c697fa3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions python/tests/test_highlevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2725,9 +2725,9 @@ def test_array_attr_properties(self, ts_fixture, array):
ts = ts_fixture
a = getattr(ts, array)
assert isinstance(a, np.ndarray)
with pytest.raises(AttributeError, match="set attribute"):
with pytest.raises(AttributeError, match="set attribute|has no setter"):
setattr(ts, array, None)
with pytest.raises(AttributeError, match="delete attribute"):
with pytest.raises(AttributeError, match="delete attribute|has no deleter"):
delattr(ts, array)
with pytest.raises(ValueError, match="read-only"):
a[:] = 1
Expand Down
4 changes: 3 additions & 1 deletion python/tests/test_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,9 @@ def test_set_metadata_schema(self):
table.metadata_schema = self.metadata_schema
assert repr(table.metadata_schema) == repr(self.metadata_schema)
# Del should fail
with pytest.raises(AttributeError, match="can't delete attribute"):
with pytest.raises(
AttributeError, match="can't delete attribute|has no deleter"
):
del table.metadata_schema
# None should fail
with pytest.raises(
Expand Down

0 comments on commit c697fa3

Please sign in to comment.