Download Brain/tests/conftest.py from posix4e/brain: direct link, hf CLI and curl.
- Browser
- Download file 440 Bytes
-
https://huggingface.co/spaces/posix4e/brain/resolve/main/Brain/tests/conftest.py
- Command line
-
hf download hf://spaces/posix4e/brain/Brain/tests/conftest.py
-
curl -L -o conftest.py https://huggingface.co/spaces/posix4e/brain/resolve/main/Brain/tests/conftest.py
440 Bytes
| import pytest | |
| from fastapi import FastAPI | |
| from fastapi.testclient import TestClient | |
| def test_client(): | |
| app = FastAPI() | |
| client = TestClient(app) | |
| # Create a test client using the FastApi application configured for testing | |
| with client as testing_client: | |
| # Establish an application context | |
| with client.app: | |
| yield testing_client # this is where the testing happens! | |