-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
SyntaxWarnings in test_fstring
#105915
Comments
The first should be - exec('f"{F():¯\_(ツ)_/¯}"', {'F': CustomFormat})
+ exec(r'f"{F():¯\_(ツ)_/¯}"', {'F': CustomFormat}) I am wondering why the second test is reporting errors. |
I cannot reproduce this locally on macOS (using 155577d), output for me:
|
I'm certain this reproduced consistently for me when I filed the report, but I can also no longer reproduce the first issue. I have no idea why this is. I can still reproduce the test failures when running the test with |
Related: #105938. Having a look. |
…ring Co-authored-by: @sunmy2019
…ring (pythonGH-105940) (cherry picked from commit 4b431d2) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com> Co-authored-by: @sunmy2019
I just now realize I could've left #105940 for any of the upcoming sprints, since it was an easy fix. Sorry for that! ❤️ |
Hmm, even with a fresh build on ======================================================================
ERROR: test_fstring_backslash_before_double_bracket_warns_once (test.test_fstring.TestCase.test_fstring_backslash_before_double_bracket_warns_once)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\alexw\coding\cpython\Lib\test\test_fstring.py", line 1052, in test_fstring_backslash_before_double_bracket_warns_once
eval(r"f'\{{'")
File "<string>", line 1
f'\{{'
^
SyntaxError: invalid escape sequence '\{'
----------------------------------------------------------------------
Ran 81 tests in 30.549s
FAILED (errors=1)
test test_fstring failed
test_fstring failed (1 error) in 30.7 sec
== Tests result: FAILURE ==
1 test failed:
test_fstring
Total duration: 30.8 sec
Tests result: FAILURE |
…tring (GH-105940) (#105942) (cherry picked from commit 4b431d2) Co-authored-by: @sunmy2019 Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
… test_fstring (pythonGH-105943) (cherry picked from commit 6e40ee6) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Bug report
Running
python -m test test_fstring
onmain
results in severalSyntaxWarnings
being emitted.If I just run
python -m test test_fstring
locally, I get this:If I run
python -We -m test test_fstring -vv
, I get a different selection of SyntaxWarnings:Your environment
Linked PRs
The text was updated successfully, but these errors were encountered: