Spaces:
Sleeping
Sleeping
Download tests/conftest.py from SONIX-RUSH/sonix-ml-api: direct link, hf CLI and curl.
- Browser
- Download file 541 Bytes
-
https://huggingface.co/spaces/SONIX-RUSH/sonix-ml-api/resolve/main/tests/conftest.py
- Command line
-
hf download hf://spaces/SONIX-RUSH/sonix-ml-api/tests/conftest.py
-
curl -L -o conftest.py https://huggingface.co/spaces/SONIX-RUSH/sonix-ml-api/resolve/main/tests/conftest.py
541 Bytes
| import pytest | |
| from unittest.mock import MagicMock | |
| def mock_supabase(mocker): | |
| """ | |
| Automatically mocks the Supabase client for all tests. | |
| This prevents real network calls to Supabase during CI. | |
| """ | |
| # Mock the create_client call in src.database | |
| mock_client = MagicMock() | |
| mocker.patch("src.database.create_client", return_value=mock_client) | |
| # Mock the 'supabase' variable itself in src.database | |
| mocker.patch("src.database.supabase", mock_client) | |
| return mock_client |