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 worker(total, blocking=True):
|
||||||
def incr_bar(x):
|
def incr_bar(x):
|
||||||
with closing(StringIO()) as our_file:
|
with closing(StringIO()) as our_file:
|
||||||
with tqdm(total=x, file=our_file,
|
for _ in trange(
|
||||||
|
total, file=our_file,
|
||||||
lock_args=None if blocking else (False,),
|
lock_args=None if blocking else (False,),
|
||||||
miniters=1, mininterval=0, maxinterval=0) as t:
|
miniters=1, mininterval=0, maxinterval=0):
|
||||||
for i in range(total):
|
pass
|
||||||
t.update()
|
|
||||||
return x + 1
|
return x + 1
|
||||||
return incr_bar
|
return incr_bar
|
||||||
|
|
||||||
|
@ -243,7 +243,7 @@ def test_lock_args():
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
total = 8
|
total = 8
|
||||||
subtotal = 100
|
subtotal = 1000
|
||||||
|
|
||||||
tqdm.set_lock(RLock())
|
tqdm.set_lock(RLock())
|
||||||
with ThreadPoolExecutor(total) as pool:
|
with ThreadPoolExecutor(total) as pool:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
from __future__ import division
|
from __future__ import division
|
||||||
from tqdm import tqdm, TMonitor
|
from tqdm import tqdm, trange, TMonitor
|
||||||
from tests_tqdm import with_setup, pretest, posttest, SkipTest, \
|
from tests_tqdm import with_setup, pretest, posttest, SkipTest, \
|
||||||
StringIO, closing
|
StringIO, closing
|
||||||
from tests_tqdm import DiscreteTimer, cpu_timify
|
from tests_tqdm import DiscreteTimer, cpu_timify
|
||||||
|
@ -43,9 +43,8 @@ def incr(x):
|
||||||
|
|
||||||
def incr_bar(x):
|
def incr_bar(x):
|
||||||
with closing(StringIO()) as our_file:
|
with closing(StringIO()) as our_file:
|
||||||
with tqdm(total=x, lock_args=(False,), file=our_file) as t:
|
for _ in trange(x, lock_args=(False,), file=our_file):
|
||||||
for i in range(x):
|
pass
|
||||||
t.update()
|
|
||||||
return incr(x)
|
return incr(x)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue