commit: 935b06a704218d327474c6fa0f91517e578b3a7f
Author: Arthur Zamarin gentoo org>
AuthorDate: Tue Nov 1 20:27:10 2022 +
Commit: Arthur Zamarin gentoo org>
CommitDate: Tue Nov 1 20:27:10 2022 +
URL:
https://gitweb.gentoo.org/proj/pkgcore/snakeoil.git/commit/?id=935b06a7
snakeoil/test/*.py: fix f-strings
Fixes: 7aed9341485ee53c0784df9e2982338e1ec271f2
Signed-off-by: Arthur Zamarin gentoo.org>
src/snakeoil/test/eq_hash_inheritance.py | 2 +-
src/snakeoil/test/slot_shadowing.py | 10 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/snakeoil/test/eq_hash_inheritance.py
b/src/snakeoil/test/eq_hash_inheritance.py
index 9eb62e4c..5012f9d3 100644
--- a/src/snakeoil/test/eq_hash_inheritance.py
+++ b/src/snakeoil/test/eq_hash_inheritance.py
@@ -17,7 +17,7 @@ class Test(mixins.TargetedNamespaceWalker,
mixins.KlassWalker):
if getattr(cls, "__hash__intentionally_disabled__", False):
return True
-namepath = "{cls.__module__}.{cls.__name__}"
+namepath = f"{cls.__module__}.{cls.__name__}"
return not namepath.startswith(self.target_namespace)
def run_check(self, cls):
diff --git a/src/snakeoil/test/slot_shadowing.py
b/src/snakeoil/test/slot_shadowing.py
index bad525c3..3e260c2e 100644
--- a/src/snakeoil/test/slot_shadowing.py
+++ b/src/snakeoil/test/slot_shadowing.py
@@ -56,7 +56,7 @@ class SlotShadowing(mixins.TargetedNamespaceWalker,
mixins.SubclassWalker):
if isinstance(slots, str):
if self.err_if_slots_is_str:
pytest.fail(
-"cls {kls!r}; slots is {slots!r} (should be a tuple or
list)")
+f"cls {kls!r}; slots is {slots!r} (should be a tuple or
list)")
slots = (slots,)
if slots is None:
@@ -65,7 +65,7 @@ class SlotShadowing(mixins.TargetedNamespaceWalker,
mixins.SubclassWalker):
if not isinstance(slots, tuple):
if self.err_if_slots_is_mutable:
pytest.fail(
-"cls {kls!r}; slots is {slots!r}- - should be a tuple")
+f"cls {kls!r}; slots is {slots!r}- - should be a tuple")
slots = tuple(slots)
if slots is None or (slots and slots in raw_slottings):
@@ -73,10 +73,10 @@ class SlotShadowing(mixins.TargetedNamespaceWalker,
mixins.SubclassWalker):
# this means that the child either didn't define __slots__, or
# daftly copied the parents... thus defeating the purpose.
pytest.fail(
-"cls {kls!r}; slots is {slots!r}, seemingly inherited from "
-"{raw_slottings[slots]!r}; the derivative class should be
__slots__ = ()")
+f"cls {kls!r}; slots is {slots!r}, seemingly inherited from "
+f"{raw_slottings[slots]!r}; the derivative class should be
__slots__ = ()")
for slot in slots:
if slot in slotting:
pytest.fail(
-"cls {kls!r}; slot {slot!r} was already defined at
{slotting[slot]!r}")
+f"cls {kls!r}; slot {slot!r} was already defined at
{slotting[slot]!r}")