* Aggiorna gli agenti e il modello del team per utilizzare OLLAMA_QWEN_1B * Riorganizza e rinomina funzioni di estrazione in moduli di mercato e notizie; migliora la gestione delle importazioni * Spostato main nel corretto file __main__ e aggiornato il README.md * Aggiunta cartella per i modelli, agenti e team * Aggiornata la posizione delle istruzioni * Rimossi TODO e Aggiunto documentazione per metodi aggregated * Aggiornate le istruzioni del coordinatore del team * utils type checks * Rinominato BaseWrapper in MarketWrapper e fix type check markets * fix type checks di notizie e social. * Aggiunti type hints finali * Riorganizzati gli import * Refactoring architetturale e spostamento classi base - Eliminazione del file __init__.py obsoleto che importava ChatManager e Pipeline - Spostamento della classe Pipeline in agents/pipeline.py - Spostamento della classe ChatManager in utils/chat_manager.py - Aggiornamento di __main__.py per importare da app.utils e app.agents, e modifica della logica per utilizzare Pipeline invece di chat per la selezione di provider e stile - Creazione della cartella base con classi base comuni: markets.py (ProductInfo, Price, MarketWrapper), news.py (Article, NewsWrapper), social.py (SocialPost, SocialComment, SocialWrapper) - Aggiornamento di tutti gli import nel progetto (markets/, news/, social/, utils/, tests/) per utilizzare la nuova struttura base/ * Aggiornato Readme * Corretto il valore predefinito della valuta in BinanceWrapper da "USDT" a "USD" * fix type in tests * fix type per models * Rinominato 'quote_currency' in 'currency' e aggiornato il trattamento del timestamp in Price * fix errors found by Copilot * WrapperHandler: semplificata la logica di chiamata delle funzioni sui wrapper * fix docs * fix demos, semplificata logica lista ollama
47 lines
1.7 KiB
Python
47 lines
1.7 KiB
Python
"""
|
|
Configurazione pytest per i test del progetto upo-appAI.
|
|
"""
|
|
|
|
import pytest
|
|
from dotenv import load_dotenv
|
|
|
|
# Carica le variabili d'ambiente per tutti i test
|
|
load_dotenv()
|
|
|
|
|
|
def pytest_configure(config:pytest.Config):
|
|
"""Configurazione pytest con marker personalizzati"""
|
|
|
|
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"),
|
|
]
|
|
for marker in markers:
|
|
line = f"{marker[0]}: {marker[1]}"
|
|
config.addinivalue_line("markers", line)
|
|
|
|
def pytest_collection_modifyitems(config: pytest.Config, items: list[pytest.Item]) -> None:
|
|
"""Modifica automaticamente degli item di test rimovendoli"""
|
|
# Rimuovo i test "limited" e "slow" se non richiesti esplicitamente
|
|
mark_to_remove = ['limited', 'slow']
|
|
for mark in mark_to_remove:
|
|
markexpr = getattr(config.option, "markexpr", None)
|
|
if markexpr and mark in markexpr.lower():
|
|
continue
|
|
|
|
new_mark = (f"({markexpr}) and " if markexpr else "") + f"not {mark}"
|
|
setattr(config.option, "markexpr", new_mark)
|