d09e5c7133
build and deploy Speckle functions / publish-automate-function-version (push) Has been cancelled
- Renamed directories and files to follow a more organized structure - Updated import statements in affected files to reflect the new directory structure
27 lines
759 B
Python
27 lines
759 B
Python
import os
|
|
import sys
|
|
from dotenv import load_dotenv
|
|
# Add the src directory to the Python path
|
|
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../src')))
|
|
|
|
|
|
def pytest_configure(config):
|
|
load_dotenv(dotenv_path=".env")
|
|
|
|
token_var = "SPECKLE_TOKEN"
|
|
server_var = "SPECKLE_SERVER_URL"
|
|
token = os.getenv(token_var)
|
|
server = os.getenv(server_var)
|
|
|
|
if not token:
|
|
raise ValueError(f"Cannot run tests without a {token_var} environment variable")
|
|
|
|
if not server:
|
|
raise ValueError(
|
|
f"Cannot run tests without a {server_var} environment variable"
|
|
)
|
|
|
|
# Set the token as an attribute on the config object
|
|
config.SPECKLE_TOKEN = token
|
|
config.SPECKLE_SERVER_URL = server
|