From 14af543ee4ee44ccabcfd1d963dc68ef0f4c6a99 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Sat, 10 Jun 2023 16:57:35 -0400 Subject: [PATCH] add tests for rewriting within fstrings --- tests/features/six_test.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/features/six_test.py b/tests/features/six_test.py index cc5e06d2..746012d8 100644 --- a/tests/features/six_test.py +++ b/tests/features/six_test.py @@ -1,5 +1,7 @@ from __future__ import annotations +import sys + import pytest from pyupgrade._data import Settings @@ -447,3 +449,9 @@ def test_fix_six(s, expected): def test_fix_base_classes(s, expected): ret = _fix_plugins(s, settings=Settings()) assert ret == expected + + +@pytest.mark.xfail(sys.version_info < (3, 12), reason='3.12+ feature') +def test_rewriting_in_fstring(): + ret = _fix_plugins('f"{six.text_type}"', settings=Settings()) + assert ret == 'f"{str}"'