-
Notifications
You must be signed in to change notification settings - Fork 186
[NOT-491] Skip live SDK tests without NOTTE_API_KEY #860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
| from pathlib import Path | ||
|
|
||
| import notte_core | ||
| import pytest | ||
|
|
||
| CONFIG_PATH = Path(__file__).parent / "test_notte_config.toml" | ||
| notte_core.set_error_mode("developer") | ||
|
|
@@ -49,3 +50,9 @@ def pytest_generate_tests(metafunc): | |
| # Apply parameterization only if any matching arguments exist | ||
| if params: | ||
| metafunc.parametrize(",".join(params.keys()), [next(iter(params.values()))]) | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def require_notte_api_key(): | ||
| if os.getenv("NOTTE_API_KEY") is None: | ||
| pytest.skip("NOTTE_API_KEY is required for live Notte API tests") | ||
|
Comment on lines
+55
to
+58
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Check whether load_dotenv is already called in conftest.py before the fixture,
# and whether os and dotenv are imported.
# Search for load_dotenv calls in conftest.py
rg -n 'load_dotenv' tests/conftest.py
# Check imports for os and dotenv
rg -n '^import os|^from dotenv|^from notte' tests/conftest.py
# Check if other test files also call load_dotenv inside the test body
rg -n 'load_dotenv' tests/sdk/test_replay_frames.py tests/sdk/test_validator.pyRepository: nottelabs/notte Length of output: 165 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== tests/conftest.py =="
wc -l tests/conftest.py
cat -n tests/conftest.py | sed -n '1,140p'
echo
echo "== load_dotenv references in tests/ =="
rg -n 'load_dotenv|NOTTE_API_KEY|require_notte_api_key' tests
echo
echo "== files that mention dotenv loading outside tests/ =="
rg -n 'load_dotenv|dotenv' .Repository: nottelabs/notte Length of output: 21594 Load 🤖 Prompt for AI Agents |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Consider checking for empty-string API key values.
os.getenv("NOTTE_API_KEY")returns""(notNone) when the variable is set but empty. The test won't skip in that case but will likely fail at the API call. Consider using a truthiness check or strip.🛡️ Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents