You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
diff --git a/tests/features/default_encoding_test.py b/tests/features/default_encoding_test.py
index f039fdc..6fb1277 100644
--- a/tests/features/default_encoding_test.py+++ b/tests/features/default_encoding_test.py@@ -38,6 +38,11 @@ from pyupgrade._main import _fix_plugins
'f"{x}(".encode()',
id='3.12+ handle open brace in fstring',
),
+ pytest.param(+ 'f"{foo(bar)}(".encode("utf-8")',+ 'f"{foo(bar)}(".encode()',+ id='f-string with function call',+ ),
),
)
def test_fix_encode(s, expected):
The corresponding test will then fail with:
...
> assert ret == expected
E assert 'f"{foo()}(".encode("utf-8")' == 'f"{foo(bar)}(".encode()'
E
E - f"{foo(bar)}(".encode()
E ? ---
E + f"{foo()}(".encode("utf-8")
E ? +++++++
tests/features/default_encoding_test.py:50: AssertionError
i.e. the fixer doesn't remove the "utf-8" literal, it removes the argument of another function call-
The text was updated successfully, but these errors were encountered:
Repro: Add the following test:
The corresponding test will then fail with:
i.e. the fixer doesn't remove the
"utf-8"
literal, it removes the argument of another function call-The text was updated successfully, but these errors were encountered: