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

Use r before string constants containing literal backslashes #53

Merged
merged 1 commit into from
Jan 29, 2022

Conversation

kalvdans
Copy link
Collaborator

Make sure to always use r"" strings when they contain backslashes. It can be tested with

pytest -W error -o 'python_files=*' tests/

It is the assert rewrite function in pytest that triggers these warnings, and its python_files option (besides its main purpose of selecting test files) decides which imported modules the assert rewrite is applied to.

(see #48 for an earlier attempt that didn't catch all occurrences)

Copy link
Owner

@lmmentel lmmentel left a comment

Choose a reason for hiding this comment

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

Thanks! 👍

@lmmentel lmmentel merged commit 76c75c0 into lmmentel:master Jan 29, 2022
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