Skip to content

Commit

Permalink
add test for tuples
Browse files Browse the repository at this point in the history
  • Loading branch information
nschloe committed Jan 31, 2022
1 parent a614048 commit 437faea
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/test_perfplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,3 +135,18 @@ def test_no_setup():
def test_n_setups():
setups = [np.random.rand] * len(kernels)
perfplot.show(setup=setups, kernels=kernels, n_range=r)


def test_return_tuples():
def setup(n):
return np.ones(n), np.full(n + 2, 3.1)

def times(a, b):
return 2 * a, 3 * b

def times_reversed(a, b):
return a * 2, b * 3

perfplot.show(
setup=setup, kernels=[times, times_reversed], n_range=[2**k for k in range(3)]
)

0 comments on commit 437faea

Please sign in to comment.