Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
fix codacy
  • Loading branch information
casperdcl committed Jul 16, 2020
1 parent b1df116 commit 3d27198
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
24 changes: 12 additions & 12 deletions tqdm/tests/py37_asyncio.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ async def acount(*args, **kwargs):
async def test_generators():
"""Test asyncio generators"""
with closing(StringIO()) as our_file:
async for row in tqdm(count(), desc="counter", file=our_file):
if row >= 8:
async for i in tqdm(count(), desc="counter", file=our_file):
if i >= 8:
break
assert '9it' in our_file.getvalue()
our_file.seek(0)
our_file.truncate()

async for row in tqdm(acount(), desc="async_counter", file=our_file):
if row >= 8:
async for i in tqdm(acount(), desc="async_counter", file=our_file):
if i >= 8:
break
assert '9it' in our_file.getvalue()

Expand All @@ -54,13 +54,13 @@ async def test_generators():
async def test_range():
"""Test asyncio range"""
with closing(StringIO()) as our_file:
async for row in tqdm(range(9), desc="range", file=our_file):
async for _ in tqdm(range(9), desc="range", file=our_file):
pass
assert '9/9' in our_file.getvalue()
our_file.seek(0)
our_file.truncate()

async for row in trange(9, desc="trange", file=our_file):
async for _ in trange(9, desc="trange", file=our_file):
pass
assert '9/9' in our_file.getvalue()

Expand All @@ -69,8 +69,8 @@ async def test_range():
async def test_nested():
"""Test asyncio nested"""
with closing(StringIO()) as our_file:
async for row in tqdm(trange(9, desc="inner", file=our_file),
desc="outer", file=our_file):
async for _ in tqdm(trange(9, desc="inner", file=our_file),
desc="outer", file=our_file):
pass
assert 'inner: 100%' in our_file.getvalue()
assert 'outer: 100%' in our_file.getvalue()
Expand All @@ -81,11 +81,11 @@ async def test_coroutines():
"""Test asyncio coroutine.send"""
with closing(StringIO()) as our_file:
with tqdm(count(), file=our_file) as pbar:
async for row in pbar:
if row == 9:
async for i in pbar:
if i == 9:
pbar.send(-10)
elif row < 0:
assert row == -9
elif i < 0:
assert i == -9
break
assert '10it' in our_file.getvalue()

Expand Down
1 change: 0 additions & 1 deletion tqdm/tests/tests_perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ def test_lock_args():
from threading import RLock
except ImportError:
raise SkipTest
import sys

total = 8
subtotal = 1000
Expand Down
4 changes: 2 additions & 2 deletions tqdm/tests/tests_tqdm.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ def test_infinite_total():
def test_nototal():
"""Test unknown total length"""
with closing(StringIO()) as our_file:
for i in tqdm((i for i in range(10)), file=our_file, unit_scale=10):
for _ in tqdm((i for i in range(10)), file=our_file, unit_scale=10):
pass
assert "100it" in our_file.getvalue()

Expand Down Expand Up @@ -1196,7 +1196,7 @@ def format_dict(self):
return d

with closing(StringIO()) as our_file:
for i in TqdmExtraFormat(
for _ in TqdmExtraFormat(
range(10), file=our_file,
bar_format="{total_time}: {percentage:.0f}%|{bar}{r_bar}"):
pass
Expand Down

0 comments on commit 3d27198

Please sign in to comment.