Repository: getmoto/moto

Issue:
Style: formats can be done with f-strings
[x] Avoid raising duplicate issues.

- Guidance on **how to reproduce the issue**.
I am using VSCode on WSL and with a query on the search tool as below,
![image](https://user-images.githubusercontent.com/29195190/196421189-94b5e439-dc50-4f4e-8d4d-3216805761d4.png)
there are 2116 format strings that can be f-strings.

- What does "success" look like for your code?
Ideally all of the strings would be replaced by f-strings.

- Tell us **what version of Moto you're using**, and **how you installed it**.
I installed moto via localstack.
`pip list` shows me `moto-ext 4.0.7.dev0 /home/wseo/localstack-dev/moto`



Discussion:

Resolving patch:
diff --git a/moto/utilities/distutils_version.py b/moto/utilities/distutils_version.py
--- a/moto/utilities/distutils_version.py
+++ b/moto/utilities/distutils_version.py
@@ -45,7 +45,7 @@ def __init__(self, vstring=None):
             self.parse(vstring)
 
     def __repr__(self):
-        return "%s ('%s')" % (self.__class__.__name__, str(self))
+        return f"{self.__class__.__name__} ('{self}')"
 
     def __eq__(self, other):
         c = self._cmp(other)
@@ -217,7 +217,7 @@ def __str__(self):
         return self.vstring
 
     def __repr__(self):
-        return "LooseVersion ('%s')" % str(self)
+        return f"LooseVersion ('{self}')"
 
     def _cmp(self, other):
         if isinstance(other, str):
diff --git a/moto/utilities/paginator.py b/moto/utilities/paginator.py
--- a/moto/utilities/paginator.py
+++ b/moto/utilities/paginator.py
@@ -20,9 +20,7 @@ def pagination_wrapper(*args, **kwargs):
             model = pagination_model
             pagination_config = model.get(method)
             if not pagination_config:
-                raise ValueError(
-                    "No pagination config for backend method: {}".format(method)
-                )
+                raise ValueError(f"No pagination config for backend method: {method}")
             # Get the pagination arguments, to be used by the paginator
             next_token_name = pagination_config.get("input_token", "next_token")
             limit_name = pagination_config.get("limit_key")
@@ -100,9 +98,7 @@ def _parse_starting_token(self):
             self._raise_exception_if_required(next_token)
             return None
         if next_token.get("parameterChecksum") != self._param_checksum:
-            raise InvalidToken(
-                "Input inconsistent with page token: {}".format(str(next_token))
-            )
+            raise InvalidToken(f"Input inconsistent with page token: {str(next_token)}")
         return next_token
 
     def _raise_exception_if_required(self, token):
diff --git a/moto/xray/exceptions.py b/moto/xray/exceptions.py
--- a/moto/xray/exceptions.py
+++ b/moto/xray/exceptions.py
@@ -5,7 +5,7 @@ def __init__(self, seg_id=None, code=None, message=None):
         self.message = message
 
     def __repr__(self):
-        return "<BadSegment {0}>".format("-".join([self.id, self.code, self.message]))
+        return f"<BadSegment {self.id}-{self.code}-{self.message}>"
 
     def to_dict(self):
         result = {}


Test patch:
diff --git a/tests/test_dynamodb/test_dynamodb.py b/tests/test_dynamodb/test_dynamodb.py
--- a/tests/test_dynamodb/test_dynamodb.py
+++ b/tests/test_dynamodb/test_dynamodb.py
@@ -3914,7 +3914,7 @@ def test_transact_write_items_put_conditional_expressions_return_values_on_condi
                 {
                     "Put": {
                         "Item": {
-                            "id": {"S": "foo{}".format(str(i))},
+                            "id": {"S": f"foo{i}"},
                             "foo": {"S": "bar"},
                         },
                         "TableName": "test-table",