pybind11/tests
aimir 9db988013c
Correct class names for KeysView, ValuesView and ItemsView in bind_map (#4353)
* Create templated abstract classes KeysView, ValuesView and ItemsView, and implement them on-the-fly when wrapping any specific map type

* We don't want to wrap different ValuesView objects for double values and const double, for example, as both wrappers will be named ValuesView[float]

* Fallback to C++ names if key or values types are not wrapped

* Added a test for .keys(), .values() and .items() returning the same types for similarly-typed maps

* Fixed wrong use of auto in a declarator list: the two descriptions might have different types

* Fixes for clang-tidy issues: explicit single-argument constructor, using the 'override' keyword when overriding functions

* Bugfix for old versions of clang++, which seem to have trouble with the struct being defined inside a module, which was also needlessly ugly anyway

* Bugfix for clang++, which doesn't have some of the names in runtime uness they are specified to be static

* A fix for clang-tidy performance-inefficient-string-concatenation issues - I personally think this looks uglier, but it's probably worth it for clang-tidy to be happy

* Possible fix for clang++ linking issues - make the descriptions static constexpr to make sure they are known before linking

* Correct names for previously-wrapped types as keys/values of maps

* Bugfix - typo in type info names which caused things to segfault

* Apply suggestions from code review

Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>

* Use detail::remove_cvref_t instead of doing remove_cv and remove_reference separately

* Avoid names with double underscore, as they are reserved

* Improved testing for KeysView, ValuesView and ItemsView: check type names + stricter asserts

* Moved description logic to helper function in type_caster_base.h

* style: pre-commit fixes

* Fix a clang-tidy issue: do not use 'else' after 'return'

* Apply suggestion by @Skylion007, with additional trivial simplification.

Co-authored-by: Amir <aimir@local>
Co-authored-by: aimir <aimir@localhost>
Co-authored-by: Aaron Gokaslan <skylion.aaron@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ralf W. Grosse-Kunstleve <rwgk@google.com>
2022-12-08 23:15:11 -08:00
..
extra_python_package Revert "feat: add entrypoint for cmake modules dir" (#4270) 2022-10-21 17:25:53 -04:00
extra_setuptools chore: drop Python 3.5 (#3719) 2022-02-11 19:06:16 -05:00
test_cmake_build chore: drop Python 3.5 (#3719) 2022-02-11 19:06:16 -05:00
test_embed Fix test added with PR #4330 (#4372) 2022-12-01 09:25:30 -08:00
CMakeLists.txt First draft of Eigen::Tensor support (#4201) 2022-10-18 16:54:16 -07:00
conftest.py chore: Convert direct multiprocessing.set_start_method("forkserver") call to a pytest fixture. (#4377) 2022-12-01 15:15:47 -05: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 error_scope to detail::get_internals() (#3981) 2022-05-31 11:51:13 -07:00
env.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -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 Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
pybind11_tests.cpp Add PYBIND11_SIMPLE_GIL_MANAGEMENT option (cmake, C++ define) (#4216) 2022-10-30 08:57:23 -07:00
pybind11_tests.h Dropping MSVC 2015 (#3722) 2022-02-14 11:36:22 -08:00
pytest.ini chore: drop Python 3.5 (#3719) 2022-02-11 19:06:16 -05:00
requirements.txt Fix: 3.11 beta support (#3923) 2022-07-06 16:35:12 -04:00
test_async.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_async.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_buffers.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_buffers.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_builtin_casters.cpp Introduce a new style of warning suppression based on push/pop (#4285) 2022-11-28 07:39:38 -08:00
test_builtin_casters.py Cast bytearray to string (#3707) 2022-02-23 18:21:03 -05:00
test_call_policies.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08: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 functional.h bug + introduce test to verify that it is fixed (#4254) 2022-11-02 11:32:53 -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: drop Python 3.5 (#3719) 2022-02-11 19:06:16 -05:00
test_class.cpp Introduce a new style of warning suppression based on push/pop (#4285) 2022-11-28 07:39:38 -08:00
test_class.py Fix casts to void* (#4275) 2022-10-22 16:52:35 -07:00
test_const_name.cpp Dropping MSVC 2015 (#3722) 2022-02-14 11:36:22 -08:00
test_const_name.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_constants_and_functions.cpp Introduce a new style of warning suppression based on push/pop (#4285) 2022-11-28 07:39:38 -08:00
test_constants_and_functions.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_copy_move.cpp Fix py::cast from pytype rvalue to pytype (#3949) 2022-05-16 13:51:01 -07: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 Open pybind11 namespace with consistent visility. (#4098) 2022-08-01 11:31:31 -07:00
test_custom_type_casters.py cast: Qualify symbol usage in PYBIND11_TYPE_CASTER (#3758) 2022-02-25 13:25:23 -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 Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_docstring_options.cpp Add option for enable/disable enum members in docstring. (#2768) 2022-12-08 23:10:10 -08: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 Introduce a new style of warning suppression based on push/pop (#4285) 2022-11-28 07:39:38 -08:00
test_eigen_matrix.py First draft of Eigen::Tensor support (#4201) 2022-10-18 16:54:16 -07:00
test_eigen_tensor_avoid_stl_array.cpp First draft of Eigen::Tensor support (#4201) 2022-10-18 16:54:16 -07:00
test_eigen_tensor.cpp First draft of Eigen::Tensor support (#4201) 2022-10-18 16:54:16 -07:00
test_eigen_tensor.inl Introduce a new style of warning suppression based on push/pop (#4285) 2022-11-28 07:39:38 -08:00
test_eigen_tensor.py Ensure config, build, toolchain, spelling, etc. issues are not masked. (#4255) 2022-10-30 13:24:41 -07:00
test_enum.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_enum.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -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 fix: unicode surrogate character in Python exception message. (#4297) 2022-10-31 12:18:05 -04:00
test_exceptions.h Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_exceptions.py Add macos_brew_install_llvm to ci.yml (#4326) 2022-11-12 12:24:19 -08:00
test_factory_constructors.cpp Dropping MSVC 2015 (#3722) 2022-02-14 11:36:22 -08:00
test_factory_constructors.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08: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 Use multiprocessing start_method "forkserver" (#4306) 2022-11-22 17:17:02 -08:00
test_iostream.cpp Dropping MSVC 2015 (#3722) 2022-02-14 11:36:22 -08:00
test_iostream.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_kwargs_and_defaults.cpp Introduce a new style of warning suppression based on push/pop (#4285) 2022-11-28 07:39:38 -08:00
test_kwargs_and_defaults.py Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08: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 Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08:00
test_methods_and_attributes.cpp Replace error printing code gated by NDEBUG with a new flag: PYBIND11_DETAILED_ERROR_MESSAGES (#3913) 2022-05-02 15:30:19 -04:00
test_methods_and_attributes.py Fix: 3.11 beta support (#3923) 2022-07-06 16:35:12 -04:00
test_modules.cpp Add missing error handling to module_::def_submodule (#3973) 2022-05-28 16:40:57 -07:00
test_modules.py Add missing error handling to module_::def_submodule (#3973) 2022-05-28 16:40:57 -07: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 First draft of Eigen::Tensor support (#4201) 2022-10-18 16:54:16 -07:00
test_numpy_array.py First draft of Eigen::Tensor support (#4201) 2022-10-18 16:54:16 -07:00
test_numpy_dtypes.cpp fix: avoid catch (...) for expected import numpy failures (#3974) 2022-05-26 11:07:40 -04:00
test_numpy_dtypes.py Expand dtype accessors (#3868) 2022-04-14 10:53:16 -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 Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -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 Python 2 removal part 1: tests (C++ code is intentionally ~untouched) (#3688) 2022-02-10 18:28:08 -08: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_pytypes.cpp fix: improve bytes to str decoding error handling (#4294) 2022-10-29 11:12:24 -04:00
test_pytypes.py fix: improve bytes to str decoding error handling (#4294) 2022-10-29 11:12:24 -04:00
test_sequences_and_iterators.cpp fix: Revert pfect args make iterator (#4234) 2022-10-21 18:04:01 -04:00
test_sequences_and_iterators.py fix: Revert pfect args make iterator (#4234) 2022-10-21 18:04:01 -04:00
test_smart_ptr.cpp Open pybind11 namespace with consistent visility. (#4098) 2022-08-01 11:31:31 -07:00
test_smart_ptr.py chore: drop Python 3.5 (#3719) 2022-02-11 19:06:16 -05:00
test_stl_binders.cpp Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08:00
test_stl_binders.py Correct class names for KeysView, ValuesView and ItemsView in bind_map (#4353) 2022-12-08 23:15:11 -08:00
test_stl.cpp Open pybind11 namespace with consistent visility. (#4098) 2022-08-01 11:31:31 -07:00
test_stl.py Add anyset & frozenset, enable copying (cast) to std::set (#3901) 2022-05-05 12:09:56 -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 Fully-automatic clang-format with include reordering (#3713) 2022-02-10 12:17:07 -08: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_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_virtual_functions.cpp chore(deps): update pre-commit hooks (#4386) 2022-12-06 10:10:48 -08:00
test_virtual_functions.py chore: drop Python 3.5 (#3719) 2022-02-11 19:06:16 -05: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