fix(benchmark): Unbreak -N/--attempts option

This commit is contained in:
Reinier van der Leer
2024-02-16 18:43:37 +01:00
parent d6ab470c58
commit f9792ed7f3
3 changed files with 4 additions and 4 deletions

View File

@@ -158,7 +158,7 @@ class BuiltinChallenge(BaseChallenge):
self,
config: AgentBenchmarkConfig,
request: pytest.FixtureRequest,
i_attempt: int = 0,
i_attempt: int,
) -> None:
# if os.environ.get("HELICONE_API_KEY"):
# from helicone.lock import HeliconeLockManager

View File

@@ -377,7 +377,7 @@ class WebArenaChallenge(BaseChallenge):
self,
config: AgentBenchmarkConfig,
request: pytest.FixtureRequest,
i_attempt: int = 0,
i_attempt: int,
) -> None:
if not self._spec.available:
pytest.skip(self._spec.unavailable_reason)

View File

@@ -216,8 +216,8 @@ def pytest_sessionfinish(session: pytest.Session) -> None:
def pytest_generate_tests(metafunc: pytest.Metafunc):
if type(n := metafunc.config.getoption("-N")) is str:
metafunc.parametrize("i_attempt", range(int(n)))
n = metafunc.config.getoption("-N")
metafunc.parametrize("i_attempt", range(int(n)) if type(n) is str else [0])
def pytest_collection_modifyitems(