Reduce tests for format strings
bytes format strings + py2 *works*, but we don't use this functionality
any more.
@@ -5,7 +5,6 @@ from __future__ import unicode_literals
import io
import pytest
-import six
from pyupgrade import _fix_format_literals
from pyupgrade import _fix_sets
@@ -19,33 +18,15 @@ from pyupgrade import unparse_parsed_string
from pyupgrade import untokenize_tokens
-def _test_roundtrip(s):
- ret = unparse_parsed_string(parse_format(s))
- assert type(ret) is type(s)
- assert ret == s
-
-
-xfailpy3 = pytest.mark.xfail(
- six.PY3, reason='PY3: no bytes formatting', strict=True,
-)
-
-
-CASES = (
+@pytest.mark.parametrize(
+ 's',
+ (
'', 'foo', '{}', '{0}', '{named}', '{!r}', '{:>5}', '{{', '}}',
- '{0!s:15}',
+ '{0!s:15}'
+ ),
)
-CASES_BYTES = tuple(x.encode('UTF-8') for x in CASES)
-
-
-@pytest.mark.parametrize('s', CASES)
def test_roundtrip_text(s):
- _test_roundtrip(s)
-
-
-@xfailpy3
-@pytest.mark.parametrize('s', CASES_BYTES)
-def test_roundtrip_bytes(s):
- _test_roundtrip(s)
+ assert unparse_parsed_string(parse_format(s)) == s
@pytest.mark.parametrize(
