refix py2 tests

This commit is contained in:
Casper da Costa-Luis 2019-12-20 18:04:49 +00:00
parent b45f24868d
commit 1435d102be
No known key found for this signature in database
GPG Key ID: 986B408043AE090D
1 changed files with 7 additions and 1 deletions

View File

@ -203,5 +203,11 @@ def test_threadpool():
tqdm.set_lock(RLock())
with ThreadPoolExecutor(8) as pool:
res = list(tqdm(pool.map(incr_bar, range(100)), disable=True))
try:
res = list(tqdm(pool.map(incr_bar, range(100)), disable=True))
except AttributeError:
if sys.version_info < (3,):
raise SkipTest
else:
raise
assert sum(res) == sum(range(1, 101))