make bench.py accept an optional script name and add a slow "manyparam" test
This commit is contained in:
parent
0d7af592c0
commit
a4466342ae
|
@ -1,9 +1,11 @@
|
||||||
|
import sys
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
import cProfile
|
import cProfile
|
||||||
import py
|
import py
|
||||||
import pstats
|
import pstats
|
||||||
stats = cProfile.run('py.test.cmdline.main(["skip.py", ])', 'prof')
|
script = sys.argv[1] if len(sys.argv) > 1 else "empty.py"
|
||||||
|
stats = cProfile.run('py.test.cmdline.main([%r])' % script, 'prof')
|
||||||
p = pstats.Stats("prof")
|
p = pstats.Stats("prof")
|
||||||
p.strip_dirs()
|
p.strip_dirs()
|
||||||
p.sort_stats('cumulative')
|
p.sort_stats('cumulative')
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
@pytest.fixture(scope='module', params=range(966))
|
||||||
|
def foo(request):
|
||||||
|
return request.param
|
||||||
|
|
||||||
|
def test_it(foo):
|
||||||
|
pass
|
||||||
|
def test_it2(foo):
|
||||||
|
pass
|
||||||
|
|
Loading…
Reference in New Issue