codacy fixes

This commit is contained in:
Casper da Costa-Luis 2020-12-25 02:19:27 +00:00
parent 59f879501c
commit 0f95bedeae
No known key found for this signature in database
GPG Key ID: 986B408043AE090D
3 changed files with 10 additions and 8 deletions

View File

@ -1,3 +1,4 @@
"""Shared pytest config."""
import sys
from tqdm import tqdm
from pytest import fixture

View File

@ -159,7 +159,7 @@ def assert_performance(thresh, name_left, time_left, name_right, time_right):
@retry_on_except()
def test_iter_basic_overhead(capsys):
def test_iter_basic_overhead():
"""Test overhead of iteration based tqdm"""
total = int(1e6)
@ -180,7 +180,7 @@ def test_iter_basic_overhead(capsys):
@retry_on_except()
def test_manual_basic_overhead(capsys):
def test_manual_basic_overhead():
"""Test overhead of manual tqdm"""
total = int(1e6)
@ -211,7 +211,7 @@ def worker(total, blocking=True):
@retry_on_except()
@patch_lock(thread=True)
def test_lock_args(capsys):
def test_lock_args():
"""Test overhead of nonblocking threads"""
ThreadPoolExecutor = importorskip('concurrent.futures').ThreadPoolExecutor
@ -234,7 +234,7 @@ def test_lock_args(capsys):
@retry_on_except(10)
def test_iter_overhead_hard(capsys):
def test_iter_overhead_hard():
"""Test overhead of iteration based tqdm (hard)"""
total = int(1e5)
@ -256,7 +256,7 @@ def test_iter_overhead_hard(capsys):
@retry_on_except(10)
def test_manual_overhead_hard(capsys):
def test_manual_overhead_hard():
"""Test overhead of manual tqdm (hard)"""
total = int(1e5)
@ -278,7 +278,7 @@ def test_manual_overhead_hard(capsys):
@retry_on_except(10)
def test_iter_overhead_simplebar_hard(capsys):
def test_iter_overhead_simplebar_hard():
"""Test overhead of iteration based tqdm vs simple progress bar (hard)"""
total = int(1e4)
@ -301,7 +301,7 @@ def test_iter_overhead_simplebar_hard(capsys):
@retry_on_except(10)
def test_manual_overhead_simplebar_hard(capsys):
def test_manual_overhead_simplebar_hard():
"""Test overhead of manual tqdm vs simple progress bar (hard)"""
total = int(1e4)

View File

@ -73,6 +73,7 @@ __all__ = ['tqdm_notebook', 'tnrange', 'tqdm', 'trange']
class TqdmHBox(HBox):
"""`ipywidgets.HBox` with a pretty representation"""
def _repr_json_(self, pretty=None):
if not hasattr(self, "pbar"):
return {}
@ -88,7 +89,7 @@ class TqdmHBox(HBox):
return super(TqdmHBox, self).__repr__()
return self.pbar.format_meter(**self._repr_json_(pretty))
def _repr_pretty_(self, pp, cycle):
def _repr_pretty_(self, pp, *_, **__):
pp.text(self.__repr__(True))