public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/pkgcore/snakeoil:master commit in: src/snakeoil/test/
@ 2022-11-01 20:23 Arthur Zamarin
  0 siblings, 0 replies; 2+ messages in thread
From: Arthur Zamarin @ 2022-11-01 20:23 UTC (permalink / raw
  To: gentoo-commits

commit:     1aa7174e22c900ed829ef9e792bfd970638f729d
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Tue Nov  1 20:20:58 2022 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Tue Nov  1 20:20:58 2022 +0000
URL:        https://gitweb.gentoo.org/proj/pkgcore/snakeoil.git/commit/?id=1aa7174e

snakeoil.test.eq_hash_inheritance: fix pytest warning

Usage of `setup` function is deprecated by pytest (was added as
compatibility layer for nose). Fix the warning by using correct name -
`setup_method`.

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 src/snakeoil/test/eq_hash_inheritance.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/snakeoil/test/eq_hash_inheritance.py b/src/snakeoil/test/eq_hash_inheritance.py
index 96cedb53..9eb62e4c 100644
--- a/src/snakeoil/test/eq_hash_inheritance.py
+++ b/src/snakeoil/test/eq_hash_inheritance.py
@@ -7,7 +7,7 @@ class Test(mixins.TargetedNamespaceWalker, mixins.KlassWalker):
 
     singleton = object()
 
-    def setup(self):
+    def setup_method(self):
         self._ignore_set = frozenset(self.iter_builtin_targets())
 
     def _should_ignore(self, cls):


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] proj/pkgcore/snakeoil:master commit in: src/snakeoil/test/
@ 2022-11-01 20:29 Arthur Zamarin
  0 siblings, 0 replies; 2+ messages in thread
From: Arthur Zamarin @ 2022-11-01 20:29 UTC (permalink / raw
  To: gentoo-commits

commit:     935b06a704218d327474c6fa0f91517e578b3a7f
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Tue Nov  1 20:27:10 2022 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Tue Nov  1 20:27:10 2022 +0000
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 <arthurzam <AT> 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}")


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-01 20:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-01 20:23 [gentoo-commits] proj/pkgcore/snakeoil:master commit in: src/snakeoil/test/ Arthur Zamarin
  -- strict thread matches above, loose matches on Subject: below --
2022-11-01 20:29 Arthur Zamarin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox