Download run_tests.py from DiabetesCareChatbot/dmChatbotBackend: direct link, hf CLI and curl.
- Browser
- Download file 846 Bytes
-
https://huggingface.co/spaces/DiabetesCareChatbot/dmChatbotBackend/resolve/main/run_tests.py
- Command line
-
hf download hf://spaces/DiabetesCareChatbot/dmChatbotBackend/run_tests.py
-
curl -L -o run_tests.py https://huggingface.co/spaces/DiabetesCareChatbot/dmChatbotBackend/resolve/main/run_tests.py
846 Bytes
| import pytest | |
| import sys | |
| import os | |
| # Insert backend directory in sys.path at the very top | |
| backend_dir = os.path.dirname(os.path.abspath(__file__)) | |
| if backend_dir not in sys.path: | |
| sys.path.insert(0, backend_dir) | |
| def run(): | |
| print("=" * 60) | |
| print("Starting Medical AI Chatbot Backend Test Suite...") | |
| print("=" * 60) | |
| # Force change CWD to backend directory | |
| os.chdir(backend_dir) | |
| # Run pytest with verbose mode and target tests/ directory | |
| exit_code = pytest.main(["-v", "tests/"]) | |
| print("\n" + "=" * 60) | |
| print("Test Execution Summary:") | |
| print("=" * 60) | |
| if exit_code == 0: | |
| print("SUCCESS: All tests passed successfully!") | |
| sys.exit(0) | |
| else: | |
| print(f"FAILURE: Test suite failed with exit code: {exit_code}") | |
| sys.exit(exit_code) | |
| if __name__ == "__main__": | |
| run() | |