mirror of
https://github.com/django-components/django-components.git
synced 2025-09-18 19:59:46 +00:00

Some checks are pending
Docs - build & deploy / docs (push) Waiting to run
Run tests / build (ubuntu-latest, 3.10) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.11) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.12) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.13) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.8) (push) Waiting to run
Run tests / test_sampleproject (3.13) (push) Waiting to run
Run tests / build (ubuntu-latest, 3.9) (push) Waiting to run
Run tests / build (windows-latest, 3.10) (push) Waiting to run
Run tests / build (windows-latest, 3.11) (push) Waiting to run
Run tests / build (windows-latest, 3.12) (push) Waiting to run
Run tests / build (windows-latest, 3.13) (push) Waiting to run
Run tests / build (windows-latest, 3.8) (push) Waiting to run
Run tests / build (windows-latest, 3.9) (push) Waiting to run
Run tests / test_docs (3.13) (push) Waiting to run
31 lines
871 B
Python
31 lines
871 B
Python
from typing import Any
|
|
|
|
from asv_runner.benchmarks.timeraw import TimerawBenchmark, _SeparateProcessTimer
|
|
|
|
|
|
# Fix for https://github.com/airspeed-velocity/asv_runner/pull/44
|
|
def _get_timer(self: Any, *param: Any) -> _SeparateProcessTimer:
|
|
"""
|
|
Returns a timer that runs the benchmark function in a separate process.
|
|
|
|
#### Parameters
|
|
**param** (`tuple`)
|
|
: The parameters to pass to the benchmark function.
|
|
|
|
#### Returns
|
|
**timer** (`_SeparateProcessTimer`)
|
|
: A timer that runs the function in a separate process.
|
|
"""
|
|
if param:
|
|
|
|
def func() -> Any:
|
|
# ---------- OUR CHANGES: ADDED RETURN STATEMENT ----------
|
|
return self.func(*param)
|
|
# ---------- OUR CHANGES END ----------
|
|
|
|
else:
|
|
func = self.func
|
|
return _SeparateProcessTimer(func)
|
|
|
|
|
|
TimerawBenchmark._get_timer = _get_timer
|