Skip to content

Commit

Permalink
liting and minor tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Nov 8, 2019
1 parent 213f302 commit 166e1bc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
12 changes: 6 additions & 6 deletions tqdm/tests/tests_perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:
Expand Down
7 changes: 3 additions & 4 deletions tqdm/tests/tests_synchronisation.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)


Expand Down

0 comments on commit 166e1bc

Please sign in to comment.