File: test_asv.py

package info (click to toggle)
flox 0.11.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,884 kB
  • sloc: python: 8,581; makefile: 154
file content (22 lines) | stat: -rw-r--r-- 585 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Run asv benchmarks as tests

import pytest

pytest.importorskip("dask")

from asv_bench.benchmarks import reduce


@pytest.mark.parametrize("problem", [reduce.ChunkReduce1D, reduce.ChunkReduce2D, reduce.ChunkReduce2DAllAxes])
def test_reduce(problem) -> None:
    testcase = problem()
    testcase.setup()
    for args in zip(*testcase.time_reduce.params):
        testcase.time_reduce(*args)


def test_reduce_bare() -> None:
    testcase = reduce.ChunkReduce1D()
    testcase.setup()
    for args in zip(*testcase.time_reduce_bare.params):
        testcase.time_reduce_bare(*args)