mirror of
https://github.com/microsoft/autogen.git
synced 2025-07-31 21:02:33 +00:00
17 lines
567 B
Python
17 lines
567 B
Python
![]() |
import pytest
|
||
|
|
||
|
skip_openai = False
|
||
|
|
||
|
|
||
|
# Registers command-line option '--skip-openai' via pytest hook.
|
||
|
# When this flag is set, it indicates that tests requiring OpenAI should be skipped.
|
||
|
def pytest_addoption(parser):
|
||
|
parser.addoption("--skip-openai", action="store_true", help="Skip all tests that require openai")
|
||
|
|
||
|
|
||
|
# pytest hook implementation extracting the '--skip-openai' command line arg and exposing it globally
|
||
|
@pytest.hookimpl(tryfirst=True)
|
||
|
def pytest_configure(config):
|
||
|
global skip_openai
|
||
|
skip_openai = config.getoption("--skip-openai", False)
|