1 |
commit: 935b06a704218d327474c6fa0f91517e578b3a7f |
2 |
Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Nov 1 20:27:10 2022 +0000 |
4 |
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Nov 1 20:27:10 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/pkgcore/snakeoil.git/commit/?id=935b06a7 |
7 |
|
8 |
snakeoil/test/*.py: fix f-strings |
9 |
|
10 |
Fixes: 7aed9341485ee53c0784df9e2982338e1ec271f2 |
11 |
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org> |
12 |
|
13 |
src/snakeoil/test/eq_hash_inheritance.py | 2 +- |
14 |
src/snakeoil/test/slot_shadowing.py | 10 +++++----- |
15 |
2 files changed, 6 insertions(+), 6 deletions(-) |
16 |
|
17 |
diff --git a/src/snakeoil/test/eq_hash_inheritance.py b/src/snakeoil/test/eq_hash_inheritance.py |
18 |
index 9eb62e4c..5012f9d3 100644 |
19 |
--- a/src/snakeoil/test/eq_hash_inheritance.py |
20 |
+++ b/src/snakeoil/test/eq_hash_inheritance.py |
21 |
@@ -17,7 +17,7 @@ class Test(mixins.TargetedNamespaceWalker, mixins.KlassWalker): |
22 |
if getattr(cls, "__hash__intentionally_disabled__", False): |
23 |
return True |
24 |
|
25 |
- namepath = "{cls.__module__}.{cls.__name__}" |
26 |
+ namepath = f"{cls.__module__}.{cls.__name__}" |
27 |
return not namepath.startswith(self.target_namespace) |
28 |
|
29 |
def run_check(self, cls): |
30 |
|
31 |
diff --git a/src/snakeoil/test/slot_shadowing.py b/src/snakeoil/test/slot_shadowing.py |
32 |
index bad525c3..3e260c2e 100644 |
33 |
--- a/src/snakeoil/test/slot_shadowing.py |
34 |
+++ b/src/snakeoil/test/slot_shadowing.py |
35 |
@@ -56,7 +56,7 @@ class SlotShadowing(mixins.TargetedNamespaceWalker, mixins.SubclassWalker): |
36 |
if isinstance(slots, str): |
37 |
if self.err_if_slots_is_str: |
38 |
pytest.fail( |
39 |
- "cls {kls!r}; slots is {slots!r} (should be a tuple or list)") |
40 |
+ f"cls {kls!r}; slots is {slots!r} (should be a tuple or list)") |
41 |
slots = (slots,) |
42 |
|
43 |
if slots is None: |
44 |
@@ -65,7 +65,7 @@ class SlotShadowing(mixins.TargetedNamespaceWalker, mixins.SubclassWalker): |
45 |
if not isinstance(slots, tuple): |
46 |
if self.err_if_slots_is_mutable: |
47 |
pytest.fail( |
48 |
- "cls {kls!r}; slots is {slots!r}- - should be a tuple") |
49 |
+ f"cls {kls!r}; slots is {slots!r}- - should be a tuple") |
50 |
slots = tuple(slots) |
51 |
|
52 |
if slots is None or (slots and slots in raw_slottings): |
53 |
@@ -73,10 +73,10 @@ class SlotShadowing(mixins.TargetedNamespaceWalker, mixins.SubclassWalker): |
54 |
# this means that the child either didn't define __slots__, or |
55 |
# daftly copied the parents... thus defeating the purpose. |
56 |
pytest.fail( |
57 |
- "cls {kls!r}; slots is {slots!r}, seemingly inherited from " |
58 |
- "{raw_slottings[slots]!r}; the derivative class should be __slots__ = ()") |
59 |
+ f"cls {kls!r}; slots is {slots!r}, seemingly inherited from " |
60 |
+ f"{raw_slottings[slots]!r}; the derivative class should be __slots__ = ()") |
61 |
|
62 |
for slot in slots: |
63 |
if slot in slotting: |
64 |
pytest.fail( |
65 |
- "cls {kls!r}; slot {slot!r} was already defined at {slotting[slot]!r}") |
66 |
+ f"cls {kls!r}; slot {slot!r} was already defined at {slotting[slot]!r}") |