blob: afce3b2c12ad51b876be06f168c4637a50ce9616 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
https://github.com/testing-cabal/testtools/commit/79fa5d41a05c423cf43a65d2b347c7c566bcdfa5
From 79fa5d41a05c423cf43a65d2b347c7c566bcdfa5 Mon Sep 17 00:00:00 2001
From: Stephen Finucane <stephen@that.guru>
Date: Fri, 21 Feb 2025 11:14:35 +0000
Subject: [PATCH] Resolve deprecation warning
See [1] for more info.
[1] https://github.com/python/cpython/issues/79893
Signed-off-by: Stephen Finucane <stephen@that.guru>
---
testtools/testcase.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/testtools/testcase.py b/testtools/testcase.py
index ad983730..4f4923b3 100644
--- a/testtools/testcase.py
+++ b/testtools/testcase.py
@@ -268,8 +268,10 @@ def _reset(self):
def __eq__(self, other):
eq = getattr(unittest.TestCase, "__eq__", None)
- if eq is not None and not unittest.TestCase.__eq__(self, other):
- return False
+ if eq is not None:
+ eq_ = unittest.TestCase.__eq__(self, other)
+ if eq_ is NotImplemented or not eq_:
+ return False
return self.__dict__ == getattr(other, "__dict__", None)
# We need to explicitly set this since we're overriding __eq__
|