Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for uncovered examples #1086

Open
sanders41 opened this issue Sep 15, 2024 · 3 comments
Open

Add tests for uncovered examples #1086

sanders41 opened this issue Sep 15, 2024 · 3 comments
Labels
good first issue Good for newcomers

Comments

@sanders41
Copy link
Owner

Some of the examples are not covered by tests yet, these should be added.

@sanders41 sanders41 added the good first issue Good for newcomers label Sep 15, 2024
@HackedRico
Copy link
Contributor

Are there specific tests that need to be written, I would like to contribute to resolving this issue too. I see that there is a directory for tests, however could not find further documentation.

@sanders41
Copy link
Owner Author

I know the fastapi example does not have any tests. To test it httpx needs to be added to the requirements.txt. Then a test client fixture is needed. Something like:

@pytest.fixture
async def test_client():
    async with AsyncClient(
        transport=ASGITransport(app=app), base_url=f"http://127.0.0.1:8000"
    ) as client:
        yield client

Then tests from here should be a good example of how to test the routes.

It's possible there are also other tests missing. I named the tests after the files, so for example test_add_documents_in_batches in test_async_examples.py is the test for async_add_documents_in_batches.py, so if any of those are missing they need to be added also.

@HackedRico
Copy link
Contributor

Awesome, thanks for getting me started, I will follow up on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants