Skip to content

Commit

Permalink
reworked test
Browse files Browse the repository at this point in the history
  • Loading branch information
bradendubois committed Jan 9, 2025
1 parent 9680e85 commit 1742c21
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tests/test_stl_binders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
BSD-style license that can be found in the LICENSE file.
*/

#include <pybind11/attr.h>
#include <pybind11/numpy.h>
#include <pybind11/stl_bind.h>

Expand Down Expand Up @@ -186,6 +187,7 @@ TEST_SUBMODULE(stl_binders, m) {

// test_set_int
py::bind_set<std::set<int>>(m, "SetInt");
// py::implicitly_convertible<py::set, std::set<int>>();

// test_map_string_double
py::bind_map<std::map<std::string, double>>(m, "MapStringDouble");
Expand Down
2 changes: 1 addition & 1 deletion tests/test_stl_binders.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,12 @@ def test_set_int():
s_a = m.SetInt()
s_b = m.SetInt()

assert len(s_a) == 0
assert s_a == s_b

s_a.add(1)

assert 1 in s_a
assert len(s_a) == 1
assert str(s_a) == "SetInt{1}"
assert s_a != s_b

Expand Down

0 comments on commit 1742c21

Please sign in to comment.