(aio_benchmark, num_models: int, authors_in_db: list[Author])
| 27 | |
| 28 | @pytest.mark.parametrize("num_models", [250, 500, 1000]) |
| 29 | async def test_sum(aio_benchmark, num_models: int, authors_in_db: list[Author]): |
| 30 | @aio_benchmark |
| 31 | async def sum_(): |
| 32 | return await Author.objects.sum("score") |
| 33 | |
| 34 | s = sum_() |
| 35 | assert 0 <= s <= 100 * num_models |
| 36 | |
| 37 | |
| 38 | @pytest.mark.parametrize("num_models", [250, 500, 1000]) |