Skip to content

Adding dedicated test_const_name. #3578

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

Merged
merged 5 commits into from
Dec 29, 2021
Merged

Adding dedicated test_const_name. #3578

merged 5 commits into from
Dec 29, 2021

Conversation

rwgk
Copy link
Collaborator

@rwgk rwgk commented Dec 28, 2021

Description

Also exercises pybind11::detail::_ backward compatibility.

See also: PR #3423

Notes:

  • clang-format was applied to test_const_name.cpp
  • Testing with MSVC 2015 is skipped due to bizarre errors that are not worth debugging. Completeness of the duplicated code for pybind11::detail::_ is sufficiently exercised on the many other platforms.
  • _<0>() and similar only works with C++17 or higher (source code comment added). This functionality is not actually used, therefore the corresponding tests were backed out.

An easy way to disable backward compatibility is to patch include/pybind11/detail/descr.h like this:

-#ifndef _
-#define PYBIND11_DETAIL_UNDERSCORE_BACKWARD_COMPATIBILITY
+#if defined(_) && defined(PYBIND11_DETAIL_UNDERSCORE_BACKWARD_COMPATIBILITY)

Suggested changelog entry:


@pytest.mark.parametrize(
"func, selector_expected",
itertools.product(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you parameterize func, and selector_expected separately, it will implicitly do an itertools.product between them.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thanks!

@rwgk rwgk marked this pull request as ready for review December 29, 2021 02:01
@rwgk rwgk requested a review from henryiii as a code owner December 29, 2021 02:01
@rwgk
Copy link
Collaborator Author

rwgk commented Dec 29, 2021

Thank you for the reviews!

@rwgk rwgk merged commit 1bbaeb3 into pybind:master Dec 29, 2021
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label Dec 29, 2021
@rwgk rwgk removed the needs changelog Possibly needs a changelog entry label Dec 29, 2021
@rwgk rwgk deleted the test_const_name branch December 29, 2021 21:12
@pastasonica
Copy link

Gg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants