Skip to content

Commit

Permalink
Update for Python 3.11 / pybind11 2.10
Browse files Browse the repository at this point in the history
kljohann committed Mar 7, 2023
1 parent 6c537fa commit 9ca18d4
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion extern/pybind11
Submodule pybind11 updated 225 files
14 changes: 7 additions & 7 deletions tests/integration/fields-and-variables_test.py
Original file line number Diff line number Diff line change
@@ -25,13 +25,13 @@ def test_static_variables_can_be_writable():


def test_static_variables_can_be_readonly():
with pytest.raises(AttributeError, match="can't set attribute"):
with pytest.raises(AttributeError, match="can't set attribute|has no setter"):
m.Example.static_const_variable = 2
with pytest.raises(AttributeError, match="can't set attribute"):
with pytest.raises(AttributeError, match="can't set attribute|has no setter"):
m.Example.static_constexpr_variable = 3
with pytest.raises(AttributeError, match="can't set attribute"):
with pytest.raises(AttributeError, match="can't set attribute|has no setter"):
m.Example.readonly_static_variable = 1
with pytest.raises(AttributeError, match="can't set attribute"):
with pytest.raises(AttributeError, match="can't set attribute|has no setter"):
m.Example.readonly_static_const_variable = 2


@@ -46,11 +46,11 @@ def test_fields_can_be_writable():

def test_fields_can_be_readonly():
inst = m.Example()
with pytest.raises(AttributeError, match="can't set attribute"):
with pytest.raises(AttributeError, match="can't set attribute|has no setter"):
inst.const_field = 2
with pytest.raises(AttributeError, match="can't set attribute"):
with pytest.raises(AttributeError, match="can't set attribute|has no setter"):
inst.readonly_field = 3
with pytest.raises(AttributeError, match="can't set attribute"):
with pytest.raises(AttributeError, match="can't set attribute|has no setter"):
inst.readonly_const_field = 4


2 changes: 1 addition & 1 deletion tests/integration/properties_test.py
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ def test_readonly_property():
inst = m.Example()
assert not hasattr(inst, "getReadonly")
assert inst.readonly == True
with pytest.raises(AttributeError, match="can't set attribute"):
with pytest.raises(AttributeError, match="can't set attribute|has no setter"):
inst.readonly = False


0 comments on commit 9ca18d4

Please sign in to comment.