@@ -187,7 +187,6 @@ def _check_variation_selection(variation_selection, perm_space_type,
187187 None ),
188188 ** kwargs
189189 )
190- brute_perm_space_tuple = tuple (brute_perm_space )
191190
192191 assert perm_space .variation_selection == variation_selection
193192 assert perm_space .sequence_length == len (sequence )
@@ -198,12 +197,9 @@ def _check_variation_selection(variation_selection, perm_space_type,
198197 not variation_selection .is_partial
199198 )
200199
201- assert perm_space .length == len (brute_perm_space_tuple )
202-
203200 if perm_space .length :
204201 assert perm_space .index (perm_space [- 1 ]) == perm_space .length - 1
205202 assert perm_space .index (perm_space [0 ]) == 0
206- assert tuple (perm_space [- 1 ]) == brute_perm_space_tuple [- 1 ]
207203
208204 if variation_selection .is_partial :
209205 assert 0 < perm_space .n_unused_elements == \
@@ -236,7 +232,7 @@ def _check_variation_selection(variation_selection, perm_space_type,
236232 # really not.
237233
238234 for i , (perm , brute_perm_tuple ) in enumerate (
239- itertools .islice (zip (perm_space , brute_perm_space_tuple ), 30 )):
235+ itertools .islice (zip (perm_space , brute_perm_space ), 30 )):
240236
241237 assert tuple (perm ) == brute_perm_tuple
242238 assert perm in perm_space
@@ -452,22 +448,28 @@ def _iterate_tests():
452448 else :
453449 slice_options = (NO_ARGUMENT ,)
454450
455- for product in combi .ProductSpace (
451+ product_space_ = combi .ProductSpace (
456452 ((variation_selection ,), perm_space_type_options ,
457453 iterable_or_length_and_sequence_options , domain_to_cut_options ,
458454 n_elements_options , is_combination_options ,
459455 purified_fixed_map_options , degrees_options , slice_options )
460- ):
461- yield (_check_variation_selection ,) + product
456+ )
457+
458+ for i in range (len (product_space_ )):
459+ fucking_globals = dict (globals ())
460+ fucking_globals .update (locals ())
461+ yield eval (
462+ 'lambda: _check_variation_selection(*product_space_[%s])' % i ,
463+ fucking_globals , locals ()
464+ )
462465
463466
464467# We use this shit because Nose can't parallelize generator tests:
465468lambdas = []
466- for i , x in enumerate (_iterate_tests ()):
467- f = lambda : x [0 ](* x [1 :])
469+ for i , f in enumerate (_iterate_tests ()):
468470 f .name = 'f_%s' % i
469471 locals ()[f .name ] = f
470472 lambdas .append (f )
471- for i , partition in enumerate (sequence_tools .partitions (lambdas , 1000 )):
473+ for i , partition in enumerate (sequence_tools .partitions (lambdas , 10 )):
472474 exec ('def test_%s(): return (%s)' %
473475 (i , ', ' .join ('%s()' % f .name for f in partition )))
0 commit comments