Skip to content

Commit 2b306f9

Browse files
committed
-
1 parent 09accad commit 2b306f9

File tree

2 files changed

+13
-17
lines changed

2 files changed

+13
-17
lines changed

source_py3/test_python_toolbox/test_logic_tools/test_all_equal.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
from 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

1717
def _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+

source_py3/test_python_toolbox/test_persistent/test_cross_process_persistent.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff 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

5150
def _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

182182
def _check_helpful_warnings_for_old_protocols(pickle_module,
183183
cross_process_persistent,

0 commit comments

Comments
 (0)