diff --git a/asv.conf.json b/asv.conf.json index bfb888c7..77fc0f97 100644 --- a/asv.conf.json +++ b/asv.conf.json @@ -24,5 +24,5 @@ "benchmark_dir": "benchmarks", "env_dir": ".asv/env", "results_dir": ".asv/results", - "html_dir": ".asv/html", + "html_dir": ".asv/html" } diff --git a/tqdm/_utils.py b/tqdm/_utils.py index 4536a1a7..4fffff46 100644 --- a/tqdm/_utils.py +++ b/tqdm/_utils.py @@ -130,13 +130,13 @@ class Comparable(object): return self._comparable == other._comparable def __ne__(self, other): - return not (self == other) + return not self == other def __gt__(self, other): - return not (self <= other) + return not self <= other def __ge__(self, other): - return not (self < other) + return not self < other def _is_utf(encoding): diff --git a/tqdm/tests/tests_main.py b/tqdm/tests/tests_main.py index f635f7ce..00b7f40b 100644 --- a/tqdm/tests/tests_main.py +++ b/tqdm/tests/tests_main.py @@ -24,7 +24,7 @@ def test_main(): # actual test: - assert (ls_out in res.replace('\r\n', '\n')) + assert ls_out in res.replace('\r\n', '\n') # semi-fake test which gets coverage: _SYS = sys.stdin, sys.argv @@ -49,7 +49,7 @@ def test_main(): sys.argv = ['', '--ascii', '--bytes', '--unit_scale', 'False'] with closing(UnicodeIO()) as fp: main(fp=fp) - assert (str(len(IN_DATA)) in fp.getvalue()) + assert str(len(IN_DATA)) in fp.getvalue() sys.stdin = IN_DATA_LIST sys.argv = ['', '-ascii', '--unit_scale', 'False', diff --git a/tqdm/tests/tests_perf.py b/tqdm/tests/tests_perf.py index b0d238ea..ac90aedc 100644 --- a/tqdm/tests/tests_perf.py +++ b/tqdm/tests/tests_perf.py @@ -172,7 +172,7 @@ def test_iter_overhead(): with relative_timer() as time_tqdm: for i in t: a += i - assert (a == (total * total - total) / 2.0) + assert a == (total * total - total) / 2.0 a = 0 with relative_timer() as time_bench: @@ -227,7 +227,7 @@ def test_iter_overhead_hard(): with relative_timer() as time_tqdm: for i in t: a += i - assert (a == (total * total - total) / 2.0) + assert a == (total * total - total) / 2.0 a = 0 with relative_timer() as time_bench: @@ -237,7 +237,7 @@ def test_iter_overhead_hard(): # Compute relative overhead of tqdm against native range() try: - assert (time_tqdm() < 60 * time_bench()) + assert time_tqdm() < 60 * time_bench() except AssertionError: raise AssertionError('trange(%g): %f, range(%g): %f' % (total, time_tqdm(), total, time_bench())) @@ -267,7 +267,7 @@ def test_manual_overhead_hard(): # Compute relative overhead of tqdm against native range() try: - assert (time_tqdm() < 100 * time_bench()) + assert time_tqdm() < 100 * time_bench() except AssertionError: raise AssertionError('tqdm(%g): %f, range(%g): %f' % (total, time_tqdm(), total, time_bench())) @@ -287,7 +287,7 @@ def test_iter_overhead_simplebar_hard(): with relative_timer() as time_tqdm: for i in t: a += i - assert (a == (total * total - total) / 2.0) + assert a == (total * total - total) / 2.0 a = 0 s = simple_progress(_range(total), file=our_file, leave=True, @@ -298,7 +298,7 @@ def test_iter_overhead_simplebar_hard(): # Compute relative overhead of tqdm against native range() try: - assert (time_tqdm() < 2.5 * time_bench()) + assert time_tqdm() < 2.5 * time_bench() except AssertionError: raise AssertionError('trange(%g): %f, simple_progress(%g): %f' % (total, time_tqdm(), total, time_bench())) @@ -330,7 +330,7 @@ def test_manual_overhead_simplebar_hard(): # Compute relative overhead of tqdm against native range() try: - assert (time_tqdm() < 2.5 * time_bench()) + assert time_tqdm() < 2.5 * time_bench() except AssertionError: raise AssertionError('tqdm(%g): %f, simple_progress(%g): %f' % (total, time_tqdm(), total, time_bench())) diff --git a/tqdm/tests/tests_synchronisation.py b/tqdm/tests/tests_synchronisation.py index c3b8ae41..c0924c63 100644 --- a/tqdm/tests/tests_synchronisation.py +++ b/tqdm/tests/tests_synchronisation.py @@ -109,7 +109,7 @@ def test_monitoring_and_cleanup(): timer.sleep(maxinterval * 2) t.update(2) timeend = timer.time() - while not (t.monitor.woken >= timeend): + while t.monitor.woken < timeend: timer.sleep(1) # Force monitor to wake up if it woken too soon sleep(0.000001) # Wait for the monitor to get out of sleep's loop and update tqdm..