py36+: pyupgrade: py36+

This commit is contained in:
Anthony Sottile
2020-10-02 13:16:22 -07:00
parent b1bcb9fba8
commit 66bd44c13a
66 changed files with 264 additions and 346 deletions

View File

@@ -176,7 +176,7 @@ class TestRaises:
def test_reinterpret_fails_with_print_for_the_fun_of_it(self):
items = [1, 2, 3]
print("items is {!r}".format(items))
print(f"items is {items!r}")
a, b = items.pop()
def test_some_error(self):

View File

@@ -11,4 +11,4 @@ def pytest_runtest_setup(item):
return
mod = item.getparent(pytest.Module).obj
if hasattr(mod, "hello"):
print("mod.hello {!r}".format(mod.hello))
print(f"mod.hello {mod.hello!r}")

View File

@@ -26,7 +26,7 @@ class Python:
def __init__(self, version, picklefile):
self.pythonpath = shutil.which(version)
if not self.pythonpath:
pytest.skip("{!r} not found".format(version))
pytest.skip(f"{version!r} not found")
self.picklefile = picklefile
def dumps(self, obj):
@@ -69,4 +69,4 @@ class Python:
@pytest.mark.parametrize("obj", [42, {}, {1: 3}])
def test_basic_objects(python1, python2, obj):
python1.dumps(obj)
python2.load_and_is_true("obj == {}".format(obj))
python2.load_and_is_true(f"obj == {obj}")

View File

@@ -40,7 +40,7 @@ class YamlItem(pytest.Item):
)
def reportinfo(self):
return self.fspath, 0, "usecase: {}".format(self.name)
return self.fspath, 0, f"usecase: {self.name}"
class YamlException(Exception):