• Kirill Smelkov's avatar
    py.bench: Fix output reporting · ed13c3f9
    Kirill Smelkov authored
    Upstream pytest changed TerminalReporter._locationline() signature from
    
    	def _locationline(self, collect_fspath, fspath, lineno, domain):
    
    to
    
    	def _locationline(self, nodeid, fspath, lineno, domain):
    
    https://github.com/pytest-dev/pytest/commit/d73e6899 .
    
    This way without adjusting py.bench was reporting just filenames instead
    of benchmark names, e.g. this way:
    
    (z-dev) kirr@deco:~/src/wendelin/wendelin.core$ ./t/py.bench bigfile/tests/bench_0virtmem.py
    =============================================================== test session starts ===============================================================
    platform linux2 -- Python 2.7.14, pytest-3.3.0, py-1.5.2, pluggy-0.6.0
    rootdir: /home/kirr/src/wendelin/wendelin.core, inifile:
    collected 11 items
    
    bigfile/tests/bench_0virtmem.py                                 0.21  (0.38 0.22 0.21)
    bigfile/tests/bench_0virtmem.py                                 0.23  (0.23 0.24 0.23)
    bigfile/tests/bench_0virtmem.py                                 0.30  (0.30 0.30 0.30)
    bigfile/tests/bench_0virtmem.py                                 0.43  (0.43 0.43 0.43)
    bigfile/tests/bench_0virtmem.py                                 0.12  (0.12 0.12 0.12)
    bigfile/tests/bench_0virtmem.py                                 0.08  (0.08 0.08 0.08)
    bigfile/tests/bench_0virtmem.py                                 0.44  (0.44 0.44 0.44)
    bigfile/tests/bench_0virtmem.py                                 0.20  (0.20 0.20 0.21)
    bigfile/tests/bench_0virtmem.py                                 0.24  (0.24 0.24 0.24)
    bigfile/tests/bench_0virtmem.py                                 0.30  (0.30 0.30 0.30)
    bigfile/tests/bench_0virtmem.py                                 0.43  (0.43 0.43 0.43)
    
    =========================================================== 11 passed in 12.39 seconds ============================================================
    
    Fix it.
    ed13c3f9
py.bench 6.16 KB