mirror of https://github.com/tqdm/tqdm.git
liting and minor tidy
This commit is contained in:
parent
213f30288c
commit
166e1bc5dc
|
@ -222,11 +222,11 @@ def test_manual_overhead():
|
|||
def worker(total, blocking=True):
|
||||
def incr_bar(x):
|
||||
with closing(StringIO()) as our_file:
|
||||
with tqdm(total=x, file=our_file,
|
||||
lock_args=None if blocking else (False,),
|
||||
miniters=1, mininterval=0, maxinterval=0) as t:
|
||||
for i in range(total):
|
||||
t.update()
|
||||
for _ in trange(
|
||||
total, file=our_file,
|
||||
lock_args=None if blocking else (False,),
|
||||
miniters=1, mininterval=0, maxinterval=0):
|
||||
pass
|
||||
return x + 1
|
||||
return incr_bar
|
||||
|
||||
|
@ -243,7 +243,7 @@ def test_lock_args():
|
|||
import sys
|
||||
|
||||
total = 8
|
||||
subtotal = 100
|
||||
subtotal = 1000
|
||||
|
||||
tqdm.set_lock(RLock())
|
||||
with ThreadPoolExecutor(total) as pool:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
from __future__ import division
|
||||
from tqdm import tqdm, TMonitor
|
||||
from tqdm import tqdm, trange, TMonitor
|
||||
from tests_tqdm import with_setup, pretest, posttest, SkipTest, \
|
||||
StringIO, closing
|
||||
from tests_tqdm import DiscreteTimer, cpu_timify
|
||||
|
@ -43,9 +43,8 @@ def incr(x):
|
|||
|
||||
def incr_bar(x):
|
||||
with closing(StringIO()) as our_file:
|
||||
with tqdm(total=x, lock_args=(False,), file=our_file) as t:
|
||||
for i in range(x):
|
||||
t.update()
|
||||
for _ in trange(x, lock_args=(False,), file=our_file):
|
||||
pass
|
||||
return incr(x)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue