From 9f9a698ee9d7e6a3f1559aac0cc415497bc1cd30 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Sat, 20 Jul 2024 00:48:35 -0700 Subject: [PATCH] Remove redundant test_class_sh_property_bakein.cpp,py --- tests/CMakeLists.txt | 1 - tests/test_class_sh_property_bakein.cpp | 35 ------------------------- tests/test_class_sh_property_bakein.py | 18 ------------- 3 files changed, 54 deletions(-) delete mode 100644 tests/test_class_sh_property_bakein.cpp delete mode 100644 tests/test_class_sh_property_bakein.py diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index bd0bbc975..1007d6d82 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -132,7 +132,6 @@ set(PYBIND11_TEST_FILES test_class_sh_mi_thunks test_class_sh_module_local.py test_class_sh_property - test_class_sh_property_bakein test_class_sh_property_non_owning test_class_sh_shared_ptr_copy_move test_class_sh_trampoline_basic diff --git a/tests/test_class_sh_property_bakein.cpp b/tests/test_class_sh_property_bakein.cpp deleted file mode 100644 index 85ede2547..000000000 --- a/tests/test_class_sh_property_bakein.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "pybind11_tests.h" - -#include - -namespace test_class_sh_property_bakein { - -struct WithCharArrayMember { - WithCharArrayMember() { std::memcpy(char6_member, "Char6", 6); } - char char6_member[6]; -}; - -struct WithConstCharPtrMember { - const char *const_char_ptr_member = "ConstChar*"; -}; - -} // namespace test_class_sh_property_bakein - -TEST_SUBMODULE(class_sh_property_bakein, m) { - m.attr("defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT") = -#ifndef PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT - false; -#else - true; - - using namespace test_class_sh_property_bakein; - - py::class_(m, "WithCharArrayMember") - .def(py::init<>()) - .def_readonly("char6_member", &WithCharArrayMember::char6_member); - - py::class_(m, "WithConstCharPtrMember") - .def(py::init<>()) - .def_readonly("const_char_ptr_member", &WithConstCharPtrMember::const_char_ptr_member); -#endif // PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT -} diff --git a/tests/test_class_sh_property_bakein.py b/tests/test_class_sh_property_bakein.py deleted file mode 100644 index 179bf8662..000000000 --- a/tests/test_class_sh_property_bakein.py +++ /dev/null @@ -1,18 +0,0 @@ -from __future__ import annotations - -import pytest - -from pybind11_tests import class_sh_property_bakein as m - -if not m.defined_PYBIND11_HAVE_INTERNALS_WITH_SMART_HOLDER_SUPPORT: - pytest.skip("smart_holder not available.", allow_module_level=True) - - -def test_readonly_char6_member(): - obj = m.WithCharArrayMember() - assert obj.char6_member == "Char6" - - -def test_readonly_const_char_ptr_member(): - obj = m.WithConstCharPtrMember() - assert obj.const_char_ptr_member == "ConstChar*"