mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2026-01-05 23:34:29 +01:00
Refactor challenges to use cycle count instead of time (#4222)
Co-authored-by: Richard Beales <rich@richbeales.net>
This commit is contained in:
@@ -1,17 +1,21 @@
|
||||
import pytest
|
||||
from _pytest.config import Config
|
||||
from _pytest.config.argparsing import Parser
|
||||
from _pytest.fixtures import FixtureRequest
|
||||
from _pytest.monkeypatch import MonkeyPatch
|
||||
|
||||
|
||||
def pytest_addoption(parser):
|
||||
def pytest_addoption(parser: Parser) -> None:
|
||||
parser.addoption(
|
||||
"--level", action="store", default=None, type=int, help="Specify test level"
|
||||
)
|
||||
|
||||
|
||||
def pytest_configure(config):
|
||||
def pytest_configure(config: Config) -> None:
|
||||
config.option.level = config.getoption("--level")
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def user_selected_level(request) -> int:
|
||||
def user_selected_level(request: FixtureRequest) -> int:
|
||||
## used for challenges in the goal oriented tests
|
||||
return request.config.option.level
|
||||
|
||||
Reference in New Issue
Block a user