diff --git a/tests/api/test_news_api.py b/tests/api/test_news_api.py index 4b6b192..839941c 100644 --- a/tests/api/test_news_api.py +++ b/tests/api/test_news_api.py @@ -5,7 +5,7 @@ from app.news import NewsApiWrapper @pytest.mark.news @pytest.mark.api -@pytest.mark.skipif(not os.getenv("NEWS_API_KEY"), reason="NEWS_API_KEY not set") +@pytest.mark.skipif(not os.getenv("NEWS_API_KEY"), reason="NEWS_API_KEY not set in environment variables") class TestNewsAPI: def test_news_api_initialization(self): diff --git a/tests/api/test_reddit.py b/tests/api/test_reddit.py index 81ab8ca..c82f56e 100644 --- a/tests/api/test_reddit.py +++ b/tests/api/test_reddit.py @@ -1,9 +1,11 @@ +import os import pytest from praw import Reddit from app.social.reddit import MAX_COMMENTS, RedditWrapper @pytest.mark.social @pytest.mark.api +@pytest.mark.skipif(not(os.getenv("REDDIT_CLIENT_ID")) or not(os.getenv("REDDIT_API_CLIENT_ID")) or not os.getenv("REDDIT_API_CLIENT_SECRET"), reason="REDDIT_CLIENT_ID and REDDIT_API_CLIENT_SECRET not set in environment variables") class TestRedditWrapper: def test_initialization(self): wrapper = RedditWrapper() diff --git a/tests/conftest.py b/tests/conftest.py index 2b7cf90..290fbf2 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -14,17 +14,20 @@ def pytest_configure(config:pytest.Config): markers = [ ("slow", "marks tests as slow (deselect with '-m \"not slow\"')"), + ("limited", "marks tests that have limited execution due to API constraints"), + ("api", "marks tests that require API access"), ("market", "marks tests that use market data"), + ("news", "marks tests that use news"), + ("social", "marks tests that use social media"), + ("wrapper", "marks tests for wrapper handler"), + + ("tools", "marks tests for tools"), + ("aggregator", "marks tests for market data aggregator"), + ("gemini", "marks tests that use Gemini model"), ("ollama_gpt", "marks tests that use Ollama GPT model"), ("ollama_qwen", "marks tests that use Ollama Qwen model"), - ("news", "marks tests that use news"), - ("social", "marks tests that use social media"), - ("limited", "marks tests that have limited execution due to API constraints"), - ("wrapper", "marks tests for wrapper handler"), - ("tools", "marks tests for tools"), - ("aggregator", "marks tests for market data aggregator"), ] for marker in markers: line = f"{marker[0]}: {marker[1]}" diff --git a/tests/tools/test_market_tool.py b/tests/tools/test_market_tool.py index 0d6d1a1..e4eff8a 100644 --- a/tests/tools/test_market_tool.py +++ b/tests/tools/test_market_tool.py @@ -3,8 +3,9 @@ import pytest from app.agents.market_agent import MarketToolkit from app.markets import MarketAPIsTool -@pytest.mark.limited # usa molte api calls e non voglio esaurire le chiavi api + @pytest.mark.tools +@pytest.mark.market @pytest.mark.api class TestMarketAPIsTool: def test_wrapper_initialization(self): diff --git a/tests/tools/test_news_tool.py b/tests/tools/test_news_tool.py index 14d142f..cb820ba 100644 --- a/tests/tools/test_news_tool.py +++ b/tests/tools/test_news_tool.py @@ -2,7 +2,6 @@ import pytest from app.news import NewsAPIsTool -@pytest.mark.limited @pytest.mark.tools @pytest.mark.news @pytest.mark.api