We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fc84fa8 commit f006cadCopy full SHA for f006cad
tests/test_past/test_misc.py
@@ -8,6 +8,7 @@
8
import os.path
9
import sys
10
import traceback
11
+from contextlib import contextmanager
12
13
from future.tests.base import unittest
14
from past.builtins import cmp
@@ -17,10 +18,16 @@
17
18
import test_values
19
20
21
+@contextmanager
22
+def empty_context_manager(*args, **kwargs):
23
+ return dict(args=args, kwargs=kwargs)
24
+
25
26
class TestCmp(unittest.TestCase):
27
def test_cmp(self):
28
for x, y, cmp_python2_value in test_values.cmp_python2_value:
- with self.subTest(x=x, y=y):
29
+ # to get this to run on python <3.4 which lacks subTest
30
+ with getattr(self, 'subTest', empty_context_manager)(x=x, y=y):
31
try:
32
past_cmp_value = cmp(x, y)
33
except Exception:
0 commit comments