diff --git a/tqdm/std.py b/tqdm/std.py index c8ba64ea..1519b7ca 100644 --- a/tqdm/std.py +++ b/tqdm/std.py @@ -546,7 +546,7 @@ class tqdm(Comparable): '{0}{1} [{2}, {3}{4}]'.format( n_fmt, unit, elapsed_str, rate_fmt, postfix) - def __new__(cls, *args, **_): + def __new__(cls, *_, **__): # Create a new instance instance = object.__new__(cls) # Construct the lock if it does not exist diff --git a/tqdm/tests/tests_synchronisation.py b/tqdm/tests/tests_synchronisation.py index c390353d..2191f22b 100644 --- a/tqdm/tests/tests_synchronisation.py +++ b/tqdm/tests/tests_synchronisation.py @@ -15,18 +15,22 @@ class Time(object): @classmethod def reset(cls): + """zeroes internal offset""" cls.offset = 0 @classmethod def time(cls): + """time.time() + offset""" return time() + cls.offset @staticmethod def sleep(dur): + """identical to time.sleep()""" return sleep(dur) @classmethod def fake_sleep(cls, dur): + """adds `dur` to internal offset""" cls.offset += dur sleep(0.000001) # sleep to allow interrupt (instead of pass) diff --git a/tqdm/tests/tests_tqdm.py b/tqdm/tests/tests_tqdm.py index 47cabc2b..af2f2601 100644 --- a/tqdm/tests/tests_tqdm.py +++ b/tqdm/tests/tests_tqdm.py @@ -1811,8 +1811,10 @@ def patch_lock(thread=True): raise SkipTest def outer(func): + """actual decorator""" @wraps(func) def inner(*args, **kwargs): + """set & reset lock even if exceptions occur""" default_lock = tqdm.get_lock() try: tqdm.set_lock(lock)