File tree Expand file tree Collapse file tree 2 files changed +13
-17
lines changed
source_py3/test_python_toolbox Expand file tree Collapse file tree 2 files changed +13
-17
lines changed Original file line number Diff line number Diff line change 88from python_toolbox .logic_tools import all_equal
99
1010
11- def _iterate_exhaustive_tests ():
11+ def test ():
1212 '''Test the basic working of `all_equal`.'''
13- yield _check , False
14- yield _check , True
13+ _check ( False )
14+ _check ( True )
1515
1616
1717def _check (exhaustive ):
@@ -53,8 +53,4 @@ def __eq__(self, other):
5353 assert all_equal (funky_floats )
5454 assert not all_equal (funky_floats , exhaustive = True )
5555
56-
57- # We use this shit because Nose can't parallelize generator tests:
58- for i , x in enumerate (_iterate_exhaustive_tests ()):
59- locals ()['f_%s' % i ] = lambda : x [0 ](* x [1 :])
60- exec ('def test_%s(): return f_%s()' % (i , i ))
56+
Original file line number Diff line number Diff line change @@ -42,10 +42,9 @@ def test():
4242 checkers = [_check_deepcopying , _check_process_passing ]
4343 cross_process_persistent_classes = [A , CrossProcessPersistent ]
4444
45- yield from itertools .product (
46- checkers ,
47- cross_process_persistent_classes ,
48- )
45+ for checker , type_ in itertools .product (checkers ,
46+ cross_process_persistent_classes ):
47+ checker (type_ )
4948
5049
5150def _check_deepcopying (cross_process_persistent_class ):
@@ -173,11 +172,12 @@ def test_helpful_warnings_for_old_protocols():
173172 )
174173
175174 for pickle_module , cross_process_persistent , old_protocol in iterator :
176- yield (_check_helpful_warnings_for_old_protocols ,
177- pickle_module ,
178- cross_process_persistent ,
179- old_protocol )
180-
175+ _check_helpful_warnings_for_old_protocols (
176+ pickle_module ,
177+ cross_process_persistent ,
178+ old_protocol
179+ )
180+
181181
182182def _check_helpful_warnings_for_old_protocols (pickle_module ,
183183 cross_process_persistent ,
You can’t perform that action at this time.
0 commit comments