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
|
From: Arthur Zamarin <arthurzam@gmail.com>
Date: Fri, 30 Jul 2021 11:38:26 +0300
[PATCH] PyPy3: fix test_issue_18468
When using the small subclass classes to test correctness of split
results, there are difference between CPython and PyPy3:
- CPython returns always the base class (for example str instead
of StrSubclass)
- PyPy3 returns the same class, so we get an StrSubclass
Based on the test, it looks like the behaviour of PyPy3 is correct,
but the test works based on CPython.
The fix was to relax the equals type to check that it is a subclass.
Signed-off-by: Arthur Zamarin <arthurzam@gmail.com>
---
regex_3/test_regex.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/regex_3/test_regex.py
+++ b/regex_3/test_regex.py
@@ -52,7 +52,7 @@ class RegexTests(unittest.TestCase):
for x, y in zip(actual, expect):
recurse(x, y)
else:
- self.assertIs(type(actual), type(expect), msg)
+ self.assertIsInstance(actual, type(expect), msg)
recurse(actual, expect)
|