Skip to content

Commit

Permalink
benchmark fixture?
Browse files Browse the repository at this point in the history
  • Loading branch information
jagerber48 committed Dec 18, 2024
1 parent 5f4d55a commit f98349e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions tests/test_performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import time
import timeit

import pytest

from uncertainties import ufloat

Expand Down Expand Up @@ -39,7 +38,7 @@ def test_complexity():
assert 0.9 * log10(n / n0) < log10(t / t0) < 1.1 * log10(n / n0)


@pytest.mark.parametrize("num", (10, 100, 1000, 10000, 100000))
@pytest.mark.benchmark
def test_speed(num):
time_ufloat_sum_benchmark(num)
def test_speed(benchmark):
num_list = (10, 100, 1000, 10000, 100000)
for num in num_list:
benchmark(lambda: time_ufloat_sum_benchmark(num))

0 comments on commit f98349e

Please sign in to comment.