Skip to content

Commit

Permalink
Merge pull request #837 from asottile/rewriting-in-fstring
Browse files Browse the repository at this point in the history
add tests for rewriting within fstrings
  • Loading branch information
asottile committed Jun 10, 2023
2 parents 4f87906 + 14af543 commit 6a8f6d7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/features/six_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import annotations

import sys

import pytest

from pyupgrade._data import Settings
Expand Down Expand Up @@ -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}"'

0 comments on commit 6a8f6d7

Please sign in to comment.