Skip to content

Commit 23aeaea

Browse files
committed
numpy: allow for benchmarks to be prefixed with bench_ instead of test_
1 parent e2744bb commit 23aeaea

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

numpy/windowing.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from scipy.sparse import random
33
import pytest
44

5-
def test_add_window(tacoBench):
5+
def bench_add_window(tacoBench):
66
dim = 10000
77
matrix = random(dim, dim, format="csr").todense()
88
def bench():
@@ -11,7 +11,7 @@ def bench():
1111
tacoBench(bench)
1212

1313
@pytest.mark.parametrize("dim", [5000, 10000, 20000])
14-
def test_add_sparse_window(tacoBench, dim):
14+
def bench_add_sparse_window(tacoBench, dim):
1515
matrix = random(dim, dim, format="csr")
1616
def bench():
1717
x = matrix[1:(dim-1), 1:(dim-1)]
@@ -21,23 +21,23 @@ def bench():
2121
tacoBench(bench)
2222

2323
@pytest.mark.parametrize("dim", [5000, 10000, 20000])
24-
def test_add_multiple_sparse_windows(tacoBench, dim):
24+
def bench_add_multiple_sparse_windows(tacoBench, dim):
2525
matrix1 = random(dim, dim, format="csr")
2626
matrix2 = random(dim, dim, format="csr")
2727
def bench():
2828
res = matrix1[1:(dim-1), 1:(dim-1)] + matrix2[1:(dim-1), 1:(dim-1)] + matrix1[0:(dim-2), 0:(dim-2)]
2929
tacoBench(bench)
3030

3131
@pytest.mark.parametrize("dim", [5000, 10000, 20000])
32-
def test_add_sparse_strided_window(tacoBench, dim):
32+
def bench_add_sparse_strided_window(tacoBench, dim):
3333
matrix = random(dim, dim, format="csr")
3434
def bench():
3535
x = matrix[1:(dim-1):2, 1:(dim-1):2]
3636
res = x + x
3737
tacoBench(bench)
3838

3939
@pytest.mark.parametrize("dim", [5000, 10000, 20000])
40-
def test_add_sparse_index_set(tacoBench, dim):
40+
def bench_add_sparse_index_set(tacoBench, dim):
4141
indexes = [i * 2 for i in range(0, dim//2)]
4242
matrix = random(dim, dim, format="csr")
4343
def bench():

pytest.ini

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
[pytest]
22
python_files = numpy/*.py
3+
python_functions = bench_*

0 commit comments

Comments
 (0)