mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-02-04 03:45:12 -05:00
19 lines
408 B
Python
19 lines
408 B
Python
import os
|
|
|
|
import pytest
|
|
|
|
|
|
def requires_api_key(env_var):
|
|
def decorator(func):
|
|
def wrapper(*args, **kwargs):
|
|
if not os.environ.get(env_var):
|
|
pytest.skip(
|
|
f"Environment variable '{env_var}' is not set, skipping the test."
|
|
)
|
|
else:
|
|
return func(*args, **kwargs)
|
|
|
|
return wrapper
|
|
|
|
return decorator
|