Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move test_stl_binders to a separate extension module. #4984

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ set(PYBIND11_TEST_FILES
test_sequences_and_iterators
test_smart_ptr
test_stl
test_stl_binders
test_stl_binders.py
test_tagbased_polymorphic
test_thread
test_type_caster_pyobject_ptr
Expand Down Expand Up @@ -220,6 +220,7 @@ tests_extra_targets("test_exceptions.py;test_local_bindings.py;test_stl.py;test_
# And add additional targets for other tests.
tests_extra_targets("test_exceptions.py" "cross_module_interleaved_error_already_set")
tests_extra_targets("test_gil_scoped.py" "cross_module_gil_utils")
tests_extra_targets("test_stl_binders.py" "stl_binders")

set(PYBIND11_EIGEN_REPO
"https://gitlab.com/libeigen/eigen.git"
Expand Down
6 changes: 3 additions & 3 deletions tests/test_stl_binders.cpp → tests/stl_binders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
#include <pybind11/numpy.h>
#include <pybind11/stl_bind.h>

#include "pybind11_tests.h"

#include <deque>
#include <map>
#include <unordered_map>
#include <vector>

namespace py = pybind11;

class El {
public:
El() = delete;
Expand Down Expand Up @@ -174,7 +174,7 @@ struct recursive_container_traits<MutuallyRecursiveContainerPairVM, SFINAE> {
} // namespace detail
} // namespace pybind11

TEST_SUBMODULE(stl_binders, m) {
PYBIND11_MODULE(stl_binders, m) {
// test_vector_int
py::bind_vector<std::vector<unsigned int>>(m, "VectorInt", py::buffer_protocol());

Expand Down
3 changes: 1 addition & 2 deletions tests/test_stl_binders.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pytest

from pybind11_tests import stl_binders as m
import stl_binders as m


def test_vector_int():
Expand Down
Loading