mirror of
https://github.com/microsoft/autogen.git
synced 2025-12-24 13:39:24 +00:00
Skip Bing tests when no API key is present. (#3757)
* Skip Bing pytests when no API key is present. * Fixed formatting. --------- Co-authored-by: Ryan Sweet <rysweet@microsoft.com>
This commit is contained in:
parent
c48d0d7867
commit
e1e9d19cb4
@ -17,17 +17,6 @@ BING_STRING = f"A Bing search for '{BING_QUERY}' found"
|
||||
BING_EXPECTED_RESULT = "https://en.wikipedia.org/wiki/Microsoft"
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
skip_all,
|
||||
reason="do not run if dependency is not installed",
|
||||
)
|
||||
def test_bing_markdown_search() -> None:
|
||||
search_engine = BingMarkdownSearch()
|
||||
results = search_engine.search(BING_QUERY)
|
||||
assert BING_STRING in results
|
||||
assert BING_EXPECTED_RESULT in results
|
||||
|
||||
|
||||
@pytest.mark.skipif(
|
||||
skip_api,
|
||||
reason="skipping tests that require a Bing API key",
|
||||
@ -41,5 +30,4 @@ def test_bing_markdown_search_api() -> None:
|
||||
|
||||
if __name__ == "__main__":
|
||||
"""Runs this file's tests from the command line."""
|
||||
test_bing_markdown_search()
|
||||
test_bing_markdown_search_api()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user