Changeset - 02c820c5c48e
[Not reviewed]
default
0 2 0
Thomas De Schampheleire - 9 years ago 2017-07-01 21:34:33
thomas.de.schampheleire@gmail.com
tests: use pytest-benchmark for performance tests

pytest-benchmark is a benchmarking suite for individual functions. It
presents itself as a pytest fixture, i.e. you accept it as a test function
argument, and then can use it to benchmark a function.

Output is presented in the following form:

----------------------------------------- benchmark: 1 tests ----------------------------------------
Name (time in s) Min Max Mean StdDev Median IQR Outliers(*) Rounds Iterations
-----------------------------------------------------------------------------------------------------
test_graphmod_git 3.1122 3.1682 3.1295 0.0236 3.1196 0.0313 1;0 5 1
-----------------------------------------------------------------------------------------------------
2 files changed with 3 insertions and 2 deletions:
0 comments (0 inline, 0 general)
dev_requirements.txt
Show inline comments
 
@@ -3,6 +3,7 @@ waitress >= 0.8.8, < 1.0
 
pytest ~= 3.0
 
pytest-runner
 
pytest-sugar>=0.7.0
 
pytest-benchmark
 
pytest-catchlog
 
pytest-localserver
 
mock
kallithea/tests/performance/test_vcs.py
Show inline comments
 
@@ -29,7 +29,7 @@ class TestVCSPerformance(TestController)
 
        jsdata = graph_data(scm_inst, revs)
 

	
 
    def test_graphmod_hg(self, benchmark):
 
        self.graphmod(HG_REPO)
 
        benchmark(self.graphmod, HG_REPO)
 

	
 
    def test_graphmod_git(self, benchmark):
 
        self.graphmod(GIT_REPO)
 
        benchmark(self.graphmod, GIT_REPO)
0 comments (0 inline, 0 general)