-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Display the filename when encountering SyntaxWarning
.
#4153
Conversation
```console $ cd t && rm -rf __pycache__ && pytest t.py -q -c /dev/null; cd .. . [100%] =============================== warnings summary =============================== <unknown>:2: DeprecationWarning: invalid escape sequence \. -- Docs: https://docs.pytest.org/en/latest/warnings.html 1 passed, 1 warnings in 0.01 seconds ``` ```console $ cd t && rm -rf __pycache__ && pytest t.py -q -c /dev/null; cd .. . [100%] =============================== warnings summary =============================== /tmp/pytest/t/t.py:2: DeprecationWarning: invalid escape sequence \. '\.wat' -- Docs: https://docs.pytest.org/en/latest/warnings.html 1 passed, 1 warnings in 0.01 seconds ```
What do you mean? A test which at least checks that the filename and |
The only assert(1, 2) # pytest has special handling for this already
def test():
x = 5 # assignment before `global` statement, a `SyntaxError` in py3+
global x
'\.' # SyntaxError in python3.8+, not a warning in python<3.6 any way I'd write this would become obsolete at some point |
I see. Well, better than nothing I guess. 😁 Can you take a look at the Travis failure please? |
hmm, passes locally:
going to click retry -- I suspect some sort of race with xdist / coverage :S |
Here's the error message in case we hit it again:
|
passed 🤷♂️ |
Weird, OK let's keep an eye on it. 👍 |
Ouch it happened again:
https://travis-ci.org/pytest-dev/pytest/jobs/441861559 😢 |
Created an issue: #4162 |
Resolves #4152
Couldn't think of a way to test this without implementation / version specific code 🤷♂️ -- at least the commit message contains the reproduction
before
after