mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2025-12-23 08:54:24 +01:00
* remove unused imports automatically * add linters to pr template * remove useless try statement
21 lines
568 B
Python
21 lines
568 B
Python
import pytest
|
|
from _pytest.config import Config
|
|
from _pytest.config.argparsing import Parser
|
|
from _pytest.fixtures import FixtureRequest
|
|
|
|
|
|
def pytest_addoption(parser: Parser) -> None:
|
|
parser.addoption(
|
|
"--level", action="store", default=None, type=int, help="Specify test level"
|
|
)
|
|
|
|
|
|
def pytest_configure(config: Config) -> None:
|
|
config.option.level = config.getoption("--level")
|
|
|
|
|
|
@pytest.fixture
|
|
def user_selected_level(request: FixtureRequest) -> int:
|
|
## used for challenges in the goal oriented tests
|
|
return request.config.option.level
|