##// END OF EJS Templates
python: compatibility for python 3.11 (issue6604)...
Raphaël Gomès -
r49089:cc9acd2c stable draft
parent child Browse files
Show More
@@ -1,9 +1,15 b''
1 from __future__ import absolute_import, print_function
1 from __future__ import absolute_import, print_function
2
2
3 import sys
3 import unittest
4 import unittest
4
5
6 if sys.version_info[0] < 3:
7 base_class = unittest._TextTestResult
8 else:
9 base_class = unittest.TextTestResult
5
10
6 class TestResult(unittest._TextTestResult):
11
12 class TestResult(base_class):
7 def __init__(self, options, *args, **kwargs):
13 def __init__(self, options, *args, **kwargs):
8 super(TestResult, self).__init__(*args, **kwargs)
14 super(TestResult, self).__init__(*args, **kwargs)
9 self._options = options
15 self._options = options
@@ -2233,12 +2233,15 b' iolock = threading.RLock()'
2233 firstlock = threading.RLock()
2233 firstlock = threading.RLock()
2234 firsterror = False
2234 firsterror = False
2235
2235
2236
2236 if PYTHON3:
2237 class TestResult(unittest._TextTestResult):
2237 base_class = unittest.TextTestResult
2238 else:
2239 base_class = unittest._TextTestResult
2240
2241
2242 class TestResult(base_class):
2238 """Holds results when executing via unittest."""
2243 """Holds results when executing via unittest."""
2239
2244
2240 # Don't worry too much about accessing the non-public _TextTestResult.
2241 # It is relatively common in Python testing tools.
2242 def __init__(self, options, *args, **kwargs):
2245 def __init__(self, options, *args, **kwargs):
2243 super(TestResult, self).__init__(*args, **kwargs)
2246 super(TestResult, self).__init__(*args, **kwargs)
2244
2247
General Comments 0
You need to be logged in to leave comments. Login now