From 092d236b4eca910ee85764eda6041b997648f0e4 Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Fri, 12 Jul 2024 08:33:55 -0700 Subject: [PATCH] Remove test_wip.cpp,py (not needed anymore). --- tests/test_wip.cpp | 32 -------------------------------- tests/test_wip.py | 26 -------------------------- 2 files changed, 58 deletions(-) delete mode 100644 tests/test_wip.cpp delete mode 100644 tests/test_wip.py diff --git a/tests/test_wip.cpp b/tests/test_wip.cpp deleted file mode 100644 index d6210917e..000000000 --- a/tests/test_wip.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include - -#include "pybind11_tests.h" - -namespace pybind11_tests { -namespace wip { - -template // Using int as a trick to easily generate a series of types. -struct Atype { - int val = 0; - explicit Atype(int val_) : val{val_} {} - int get() const { return val * 10 + SerNo; } -}; - -int mixed(std::unique_ptr> at1, std::unique_ptr> at2) { - return at1->get() * 200 + at2->get() * 20; -} - -} // namespace wip -} // namespace pybind11_tests - -using namespace pybind11_tests::wip; - -PYBIND11_SMART_HOLDER_TYPE_CASTERS(Atype<1>) -PYBIND11_SMART_HOLDER_TYPE_CASTERS(Atype<2>) - -TEST_SUBMODULE(wip, m) { - py::classh>(m, "Atype1").def(py::init()).def("get", &Atype<1>::get); - py::classh>(m, "Atype2").def(py::init()).def("get", &Atype<2>::get); - - m.def("mixed", mixed); -} diff --git a/tests/test_wip.py b/tests/test_wip.py deleted file mode 100644 index f4f7680fc..000000000 --- a/tests/test_wip.py +++ /dev/null @@ -1,26 +0,0 @@ -from __future__ import annotations - -import pytest - -from pybind11_tests import wip as m - - -def test_mixed(): - obj1a = m.Atype1(90) - obj2a = m.Atype2(25) - obj1b = m.Atype1(0) - obj2b = m.Atype2(0) - - print("\nLOOOK A BEFORE m.mixed(obj1a, obj2a)", flush=True) - assert m.mixed(obj1a, obj2a) == (90 * 10 + 1) * 200 + (25 * 10 + 2) * 20 - print("\nLOOOK A AFTER m.mixed(obj1a, obj2a)", flush=True) - - print("\nLOOOK B BEFORE m.mixed(obj1b, obj2a)", flush=True) - with pytest.raises(ValueError): - m.mixed(obj1b, obj2a) - print("\nLOOOK B AFTER m.mixed(obj1b, obj2a)", flush=True) - - print("\nLOOOK C BEFORE m.mixed(obj1a, obj2b)", flush=True) - with pytest.raises(ValueError): - m.mixed(obj1a, obj2b) - print("\nLOOOK C AFTER m.mixed(obj1a, obj2b)", flush=True)