pybind11/tests
Ralf W. Grosse-Kunstleve ab955f158c
Fix refcount bug involving trampoline functions with PyObject * return type. (#5156)
* Transfer diff from pybind11k fork as-is. New tests are still missing.

* Add `PYBIND11_WARNING_DISABLE_MSVC(4127)` into `PYBIND11_OVERRIDE_IMPL` macro.

* Add test_trampoline_with_pyobject_ptr_return()

* Resolve clang-tidy error: use auto when initializing with a template cast to avoid duplicating the type name [modernize-use-auto,-warnings-as-errors]

* Disabled checking refcount when building with PyPy.

* Clang 3.6, 3.7, 3.9 compatibility.

```
/__w/pybind11/pybind11/tests/test_type_caster_pyobject_ptr.cpp:23:13: error: definition of implicit copy constructor for 'WithPyObjectPtrReturn' is deprecated because it has a user-declared destructor [-Werror,-Wdeprecated]
    virtual ~WithPyObjectPtrReturn() = default;
            ^
```

* Minor clean-up of production code changes.

* Add missing `override` (to resolve clang-tidy error).

* Move PYBIND11_WARNING_POP for a better clang-format outcome.
2024-06-11 14:00:52 -07:00
..
extra_python_package fix(cmake): improved cross-compilation support (#5083) 2024-06-06 17:17:54 -04:00
extra_setuptools chore: drop Python 3.5 (#3719) 2022-02-11 19:06:16 -05:00
test_cmake_build chore: bump cmake to 3.29 (#5075) 2024-03-27 20:11:13 -04:00
test_embed fix: Python 3.13t with GIL (#5139) 2024-05-28 09:07:59 -04:00
CMakeLists.txt fix(cmake): old cmake boost bug (#5149) 2024-05-29 20:33:25 -04:00
conftest.py feat: make numpy.h compatible with both NumPy 1.x and 2.x (#5050) 2024-03-26 18:20:11 -04:00
constructor_stats.h test: ConstructorStats newline (PyPy) (#4167) 2022-08-29 23:25:01 -04:00
cross_module_gil_utils.cpp Add PYBIND11_SIMPLE_GIL_MANAGEMENT option (cmake, C++ define) (#4216) 2022-10-30 08:57:23 -07:00
cross_module_interleaved_error_already_set.cpp Add py::set_error(), use in updated py::exception<> documentation (#4772) 2023-08-07 20:48:20 -07:00
eigen_tensor_avoid_stl_array.cpp Fix ODR violations in our Eigen Tensor tests (#4412) 2022-12-20 05:34:00 -08:00
env.py chore: move to Ruff and add rules (#4483) 2023-02-22 06:18:55 -08:00
local_bindings.h Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
object.h Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
pybind11_cross_module_tests.cpp Add py::set_error(), use in updated py::exception<> documentation (#4772) 2023-08-07 20:48:20 -07:00
pybind11_tests.cpp fix: Python 3.13t with GIL (#5139) 2024-05-28 09:07:59 -04:00
pybind11_tests.h Dropping MSVC 2015 (#3722) 2022-02-14 11:36:22 -08:00
pytest.ini chore: some cleanup (#5137) 2024-05-24 12:26:40 -04:00
requirements.txt fix: Use PyObject_VisitManagedDict() of Python 3.13 (#4973) 2023-12-14 18:42:55 -08:00
test_async.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_async.py chore: move to Ruff and add rules (#4483) 2023-02-22 06:18:55 -08:00
test_buffers.cpp Add format_descriptor<> & npy_format_descriptor<> PyObject * specializations. (#4674) 2023-05-23 10:49:32 -07:00
test_buffers.py Update render for buffer sequence and handle (#4831) 2023-09-12 12:47:39 -07:00
test_builtin_casters.cpp chore(deps): update pre-commit hooks (#5084) 2024-04-02 11:14:08 -04:00
test_builtin_casters.py fix: Use lowercase builtin collection names (#4833) 2023-09-12 12:46:58 -07:00
test_call_policies.cpp chore(deps): update pre-commit hooks (#5084) 2024-04-02 11:14:08 -04:00
test_call_policies.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_callbacks.cpp Fix functional.h bug + introduce test to verify that it is fixed (#4254) 2022-11-02 11:32:53 -07:00
test_callbacks.py fix: Render py::function as Callable (#4829) 2023-08-30 22:43:01 -07:00
test_chrono.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_chrono.py chore: update to black 23 (#4482) 2023-02-01 14:23:37 -05:00
test_class.cpp chore(deps): update pre-commit hooks (#5123) 2024-05-10 17:03:51 -04:00
test_class.py fix: Python 3.13t with GIL (#5139) 2024-05-28 09:07:59 -04:00
test_const_name.cpp Dropping MSVC 2015 (#3722) 2022-02-14 11:36:22 -08:00
test_const_name.py chore: move to Ruff and add rules (#4483) 2023-02-22 06:18:55 -08:00
test_constants_and_functions.cpp tests: hide warning on clang (#5069) 2024-03-26 13:57:05 -04:00
test_constants_and_functions.py bugfix: allow noexcept lambdas in C++17. Fix #4565 (#4593) 2023-03-27 20:21:06 -04:00
test_copy_move.cpp chore(deps): update pre-commit hooks (#5084) 2024-04-02 11:14:08 -04:00
test_copy_move.py Fix py::cast from pytype rvalue to pytype (#3949) 2022-05-16 13:51:01 -07:00
test_custom_type_casters.cpp chore(deps): update pre-commit hooks (#5084) 2024-04-02 11:14:08 -04:00
test_custom_type_casters.py chore: move to Ruff and add rules (#4483) 2023-02-22 06:18:55 -08:00
test_custom_type_setup.cpp Add custom_type_setup attribute (#3287) 2021-09-24 12:08:22 -07:00
test_custom_type_setup.py chore: move to Ruff and add rules (#4483) 2023-02-22 06:18:55 -08:00
test_docstring_options.cpp chore(deps): update pre-commit hooks (#5084) 2024-04-02 11:14:08 -04:00
test_docstring_options.py Add option for enable/disable enum members in docstring. (#2768) 2022-12-08 23:10:10 -08:00
test_eigen_matrix.cpp chore(deps): update pre-commit hooks (#5084) 2024-04-02 11:14:08 -04:00
test_eigen_matrix.py feat: make numpy.h compatible with both NumPy 1.x and 2.x (#5050) 2024-03-26 18:20:11 -04:00
test_eigen_tensor.cpp Fix ODR violations in our Eigen Tensor tests (#4412) 2022-12-20 05:34:00 -08:00
test_eigen_tensor.inl chore(deps): update pre-commit hooks (#5084) 2024-04-02 11:14:08 -04:00
test_eigen_tensor.py chore: move to Ruff and add rules (#4483) 2023-02-22 06:18:55 -08:00
test_enum.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_enum.py chore: move to ruff-format (#4912) 2023-11-07 23:42:54 -08:00
test_eval_call.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_eval.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_eval.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_exceptions.cpp Bug fixes: Add missing handle_type_name specializations. (#5073) 2024-03-27 12:39:05 -07:00
test_exceptions.h Add py::set_error(), use in updated py::exception<> documentation (#4772) 2023-08-07 20:48:20 -07:00
test_exceptions.py Bug fixes: Add missing handle_type_name specializations. (#5073) 2024-03-27 12:39:05 -07:00
test_factory_constructors.cpp Dropping MSVC 2015 (#3722) 2022-02-14 11:36:22 -08:00
test_factory_constructors.py Update render for buffer sequence and handle (#4831) 2023-09-12 12:47:39 -07:00
test_gil_scoped.cpp Add PYBIND11_SIMPLE_GIL_MANAGEMENT option (cmake, C++ define) (#4216) 2022-10-30 08:57:23 -07:00
test_gil_scoped.py chore: move to Ruff and add rules (#4483) 2023-02-22 06:18:55 -08:00
test_iostream.cpp Dropping MSVC 2015 (#3722) 2022-02-14 11:36:22 -08:00
test_iostream.py chore(deps): update pre-commit hooks (#5084) 2024-04-02 11:14:08 -04:00
test_kwargs_and_defaults.cpp fix: Python 3.13t with GIL (#5139) 2024-05-28 09:07:59 -04:00
test_kwargs_and_defaults.py tests: avoid immortal objects in tests (#5150) 2024-05-30 01:40:55 -04:00
test_local_bindings.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_local_bindings.py chore: update to black 23 (#4482) 2023-02-01 14:23:37 -05:00
test_methods_and_attributes.cpp chore(deps): update pre-commit hooks (#5084) 2024-04-02 11:14:08 -04:00
test_methods_and_attributes.py chore: move to ruff-format (#4912) 2023-11-07 23:42:54 -08:00
test_modules.cpp Add missing error handling to module_::def_submodule (#3973) 2022-05-28 16:40:57 -07:00
test_modules.py Remove test code that does not exercise anything in pybind11, but breaks between Python 3.12alpha3 (still working) and 3.12alpha6 (broken): (#4559) 2023-03-09 13:02:34 -08:00
test_multiple_inheritance.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_multiple_inheritance.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_numpy_array.cpp chore(deps): update pre-commit hooks (#5084) 2024-04-02 11:14:08 -04:00
test_numpy_array.py feat: make numpy.h compatible with both NumPy 1.x and 2.x (#5050) 2024-03-26 18:20:11 -04:00
test_numpy_dtypes.cpp chore(deps): update pre-commit hooks (#5123) 2024-05-10 17:03:51 -04:00
test_numpy_dtypes.py chore(deps): update pre-commit hooks (#5084) 2024-04-02 11:14:08 -04:00
test_numpy_vectorize.cpp fix: avoid catch (...) for expected import numpy failures (#3974) 2022-05-26 11:07:40 -04:00
test_numpy_vectorize.py chore: move to Ruff and add rules (#4483) 2023-02-22 06:18:55 -08:00
test_opaque_types.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_opaque_types.py chore: drop Python 3.5 (#3719) 2022-02-11 19:06:16 -05:00
test_operator_overloading.cpp Introduce a new style of warning suppression based on push/pop (#4285) 2022-11-28 07:39:38 -08:00
test_operator_overloading.py chore: update to black 23 (#4482) 2023-02-01 14:23:37 -05:00
test_pickling.cpp Test pickling a simple callable (does not work). (#3906) 2022-05-02 12:39:36 -07:00
test_pickling.py Test pickling a simple callable (does not work). (#3906) 2022-05-02 12:39:36 -07:00
test_python_multiple_inheritance.cpp Fix a long-standing bug in the handling of Python multiple inheritance (#4762) 2023-11-08 12:44:04 -08:00
test_python_multiple_inheritance.py Fix a long-standing bug in the handling of Python multiple inheritance (#4762) 2023-11-08 12:44:04 -08:00
test_pytypes.cpp Add a pybind function to clear a list. (#5153) 2024-06-07 13:54:33 -07:00
test_pytypes.py Add a pybind function to clear a list. (#5153) 2024-06-07 13:54:33 -07:00
test_sequences_and_iterators.cpp feature: Support move-only iterators in py::make_*iterator (#4834) 2023-09-07 05:57:39 -07:00
test_sequences_and_iterators.py feature: Use typed iterators in make_*iterator (#4876) 2023-10-17 12:04:46 -07:00
test_smart_ptr.cpp Fix Clazy warnings (#4988) 2023-12-29 21:59:47 -08:00
test_smart_ptr.py chore: drop Python 3.5 (#3719) 2022-02-11 19:06:16 -05:00
test_stl_binders.cpp chore(deps): update pre-commit hooks (#5084) 2024-04-02 11:14:08 -04:00
test_stl_binders.py bugfix: removing typing and duplicate `class_` for KeysView/ValuesView/ItemsView. Fix #4529 (#4985) 2024-01-13 11:07:36 -08:00
test_stl.cpp chore(deps): update pre-commit hooks (#5123) 2024-05-10 17:03:51 -04:00
test_stl.py fix: Use lowercase builtin collection names (#4833) 2023-09-12 12:46:58 -07:00
test_tagbased_polymorphic.cpp Open pybind11 namespace with consistent visility. (#4098) 2022-08-01 11:31:31 -07:00
test_tagbased_polymorphic.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_thread.cpp chore(deps): update pre-commit hooks (#5123) 2024-05-10 17:03:51 -04:00
test_thread.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_type_caster_pyobject_ptr.cpp Fix refcount bug involving trampoline functions with PyObject * return type. (#5156) 2024-06-11 14:00:52 -07:00
test_type_caster_pyobject_ptr.py Fix refcount bug involving trampoline functions with PyObject * return type. (#5156) 2024-06-11 14:00:52 -07:00
test_union.cpp Fix assertion failure for unions (#1685) (#1709) 2019-06-11 23:28:58 +02:00
test_union.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_unnamed_namespace_a.cpp Use std::hash<std::type_index>, std::equal_to<std::type_index> everywhere **except when libc++ is in use** (#4319) 2023-04-25 14:03:24 -07:00
test_unnamed_namespace_a.py Use std::hash<std::type_index>, std::equal_to<std::type_index> everywhere **except when libc++ is in use** (#4319) 2023-04-25 14:03:24 -07:00
test_unnamed_namespace_b.cpp Use std::hash<std::type_index>, std::equal_to<std::type_index> everywhere **except when libc++ is in use** (#4319) 2023-04-25 14:03:24 -07:00
test_unnamed_namespace_b.py Use std::hash<std::type_index>, std::equal_to<std::type_index> everywhere **except when libc++ is in use** (#4319) 2023-04-25 14:03:24 -07:00
test_vector_unique_ptr_member.cpp Remove stray comment. (Oversight in PR #4631. Noticed by chance.) (#4641) 2023-04-27 07:24:48 -07:00
test_vector_unique_ptr_member.py Introduce pybind11::detail::is_move_constructible (#4631) 2023-04-24 00:19:21 -07:00
test_virtual_functions.cpp chore(deps): update pre-commit hooks (#4386) 2022-12-06 10:10:48 -08:00
test_virtual_functions.py chore: move to Ruff and add rules (#4483) 2023-02-22 06:18:55 -08:00
valgrind-numpy-scipy.supp docs: fix various typos (#3075) 2021-07-04 19:58:35 -04:00
valgrind-python.supp chore: get PyPy 3.7 wheels using NumPy 1.20 (#2837) 2021-01-31 17:29:09 -05:00