mirror of https://github.com/tqdm/tqdm.git
tests: fix py2.7
This commit is contained in:
parent
4328762e54
commit
839e672748
|
@ -800,12 +800,13 @@ def test_smoothed_dynamic_min_iters_with_min_interval():
|
||||||
@mark.slow
|
@mark.slow
|
||||||
def test_rlock_creation():
|
def test_rlock_creation():
|
||||||
"""Test that importing tqdm does not create multiprocessing objects."""
|
"""Test that importing tqdm does not create multiprocessing objects."""
|
||||||
importorskip('multiprocessing')
|
mp = importorskip('multiprocessing')
|
||||||
from multiprocessing import get_context
|
if not hasattr(mp, 'get_context'):
|
||||||
|
skip("missing multiprocessing.get_context")
|
||||||
|
|
||||||
# Use 'spawn' instead of 'fork' so that the process does not inherit any
|
# Use 'spawn' instead of 'fork' so that the process does not inherit any
|
||||||
# globals that have been constructed by running other tests
|
# globals that have been constructed by running other tests
|
||||||
ctx = get_context('spawn')
|
ctx = mp.get_context('spawn')
|
||||||
with ctx.Pool(1) as pool:
|
with ctx.Pool(1) as pool:
|
||||||
# The pool will propagate the error if the target method fails
|
# The pool will propagate the error if the target method fails
|
||||||
pool.apply(_rlock_creation_target)
|
pool.apply(_rlock_creation_target)
|
||||||
|
|
Loading…
Reference in New Issue