Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cosmetics: better test helper name #278

Merged
merged 2 commits into from
Jan 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions tests/test_reusable_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,8 @@ def c_exit(exitcode=0):
libc.exit(exitcode)


def check_pids_exist_then_sleep(arg):
"""Sleep for some time before returning
and check if all the passed pid exist"""
def sleep_then_check_pids_exist(arg):
"""Sleep for some time and the check if all the passed pids exist"""
time, pids = arg
sleep(time)
res = True
Expand Down Expand Up @@ -352,7 +351,7 @@ def test_crash_races(self, n_proc):
pids = list(executor._processes.keys())
assert len(pids) == n_proc
assert None not in pids
res = executor.map(check_pids_exist_then_sleep,
res = executor.map(sleep_then_check_pids_exist,
[(.0001 * (j // 2), pids)
for j in range(2 * n_proc)])
assert all(list(res))
Expand Down Expand Up @@ -486,7 +485,7 @@ def test_reusable_executor_resize(self):
# the old one as it is still in a good shape. The resize should not
# occur while there are on going works.
pids = list(executor._processes.keys())
res1 = executor.submit(check_pids_exist_then_sleep, (.3, pids))
res1 = executor.submit(sleep_then_check_pids_exist, (.3, pids))
clean_warning_registry()
with warnings.catch_warnings(record=True) as w:
# Cause all warnings to always be triggered.
Expand Down