Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sarlinpe committed Oct 6, 2024
1 parent 71e8a37 commit f2d1951
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_stl_binders.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,14 @@ def test_map_delitem():
assert list(mm) == ["b"]
assert list(mm.items()) == [("b", 2.5)]

with pytest.raises(KeyError) as excinfo:
_ = mm["a_long_key"]
assert "a_long_key" in excinfo.value

Check failure on line 307 in tests/test_stl_binders.py

View workflow job for this annotation

GitHub Actions / 🐍 3.8 β€’ ubuntu-20.04 β€’ x64 -DPYBIND11_FINDPYTHON=ON -DCMAKE_CXX_FLAGS="-D_=1"

test_map_delitem TypeError: argument of type 'KeyError' is not iterable

Check failure on line 307 in tests/test_stl_binders.py

View workflow job for this annotation

GitHub Actions / 🐍 3.11 β€’ ubuntu-latest β€’ x64

test_map_delitem TypeError: argument of type 'KeyError' is not iterable

Check failure on line 307 in tests/test_stl_binders.py

View workflow job for this annotation

GitHub Actions / 🐍 3.13 β€’ ubuntu-20.04 β€’ x64

test_map_delitem TypeError: argument of type 'KeyError' is not iterable

Check failure on line 307 in tests/test_stl_binders.py

View workflow job for this annotation

GitHub Actions / 🐍 3.9 β€’ ubuntu-20.04 β€’ x64

test_map_delitem TypeError: argument of type 'KeyError' is not iterable

Check failure on line 307 in tests/test_stl_binders.py

View workflow job for this annotation

GitHub Actions / 🐍 3.12 β€’ ubuntu-20.04 β€’ x64

test_map_delitem TypeError: argument of type 'KeyError' is not iterable

Check failure on line 307 in tests/test_stl_binders.py

View workflow job for this annotation

GitHub Actions / 🐍 pypy-3.10 β€’ ubuntu-20.04 β€’ x64

test_map_delitem TypeError: 'KeyError' object is not iterable

Check failure on line 307 in tests/test_stl_binders.py

View workflow job for this annotation

GitHub Actions / 🐍 pypy-3.8 β€’ ubuntu-20.04 β€’ x64 -DPYBIND11_FINDPYTHON=ON

test_map_delitem TypeError: 'KeyError' object is not iterable

Check failure on line 307 in tests/test_stl_binders.py

View workflow job for this annotation

GitHub Actions / 🐍 pypy-3.9 β€’ ubuntu-20.04 β€’ x64

test_map_delitem TypeError: 'KeyError' object is not iterable

with pytest.raises(KeyError) as excinfo:
del mm["a_long_key"]
assert "a_long_key" in excinfo.value

um = m.UnorderedMapStringDouble()
um["ua"] = 1.1
um["ub"] = 2.6
Expand Down

0 comments on commit f2d1951

Please sign in to comment.