Skip to content
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

Escape arguments to macro call 'create_test' #49

Merged
merged 1 commit into from
Jan 19, 2025

Conversation

corrodedHash
Copy link
Contributor

Pytest does not convert escape characters in strings of parameterized tests

In CMake, if those escape characters then get converted, the test names are not found anymore.

Thus, escape the variables carefully when handling them during the test creation.

@corrodedHash
Copy link
Contributor Author

This is a weird edge case I found, because I parameterized my test with different white-space characters.

It is actually really surprising and impressive that Pytest handles the escaping this way.

@buddly27
Copy link
Collaborator

Ah, good catch! I'll make the necessary adjustments to the tests over the weekend to get this merged. Thank you!

It is actually really surprising and impressive that Pytest handles the escaping this way.

Agreed, I wouldn’t have expected it to work!

@buddly27 buddly27 self-assigned this Jan 18, 2025
Updated pytest_discover_tests to handle escaped characters in test names
and identifiers, ensuring compatibility with parameterized tests that include
such characters.
@buddly27 buddly27 merged commit c91dd36 into python-cmake:main Jan 19, 2025
72 checks passed
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.

2 participants