test: perf: tighten crucial important tests, add to pre-commit

This commit is contained in:
Casper da Costa-Luis 2020-10-08 13:57:50 +01:00
parent 4db32a33c5
commit ab32d02ec6
No known key found for this signature in database
GPG Key ID: 986B408043AE090D
2 changed files with 10 additions and 9 deletions

View File

@ -51,7 +51,7 @@ test:
tox -e perf
testnose:
nosetests tqdm -d -v
nosetests -d -v tqdm
testsetup:
@make README.rst
@ -62,14 +62,14 @@ testsetup:
testcoverage:
@make coverclean
nosetests tqdm --with-coverage --cover-package=tqdm --cover-erase --cover-min-percentage=80 --ignore-files="tests_perf\.py" -d -v
nosetests -d -v tqdm --ignore-files="tests_perf\.py" --with-coverage --cover-package=tqdm --cover-erase --cover-min-percentage=80
testperf:
# do not use coverage (which is extremely slow)
nosetests tqdm/tests/tests_perf.py -d -v
nosetests -d -v tqdm/tests/tests_perf.py
testtimer:
nosetests tqdm --with-timer -d -v
nosetests -d -v tqdm --with-timer
# another performance test, to check evolution across commits
testasv:
@ -121,7 +121,8 @@ pre-commit:
# quick sanity checks
@make testsetup
flake8 -j 8 --count --statistics tqdm/ examples/
nosetests tqdm --ignore-files="tests_(perf|keras)\.py" -e "pandas|monitoring" -d
nosetests -d tqdm --ignore-files="tests_(perf|keras)\.py" -e "pandas|monitoring"
nosetests -d tqdm/tests/tests_perf.py -m basic_overhead
prebuildclean:
@+python -c "import shutil; shutil.rmtree('build', True)"
@+python -c "import shutil; shutil.rmtree('dist', True)"

View File

@ -172,7 +172,7 @@ def assert_performance(thresh, name_left, time_left, name_right, time_right):
@with_setup(pretest, posttest)
@retry_on_except()
def test_iter_overhead():
def test_iter_basic_overhead():
"""Test overhead of iteration based tqdm"""
total = int(1e6)
@ -191,12 +191,12 @@ def test_iter_overhead():
a += i
our_file.write(a)
assert_performance(6, 'trange', time_tqdm(), 'range', time_bench())
assert_performance(3, 'trange', time_tqdm(), 'range', time_bench())
@with_setup(pretest, posttest)
@retry_on_except()
def test_manual_overhead():
def test_manual_basic_overhead():
"""Test overhead of manual tqdm"""
total = int(1e6)
@ -215,7 +215,7 @@ def test_manual_overhead():
a += i
our_file.write(a)
assert_performance(6, 'tqdm', time_tqdm(), 'range', time_bench())
assert_performance(5, 'tqdm', time_tqdm(), 'range', time_bench())
def worker(total, blocking=True):