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

Starlette's TestClient unused #111

Closed
Toreno96 opened this issue Feb 11, 2020 · 6 comments
Closed

Starlette's TestClient unused #111

Toreno96 opened this issue Feb 11, 2020 · 6 comments

Comments

@Toreno96
Copy link

Hi,

The official FastAPI's tutorial recommends to use Starlette's TestClient in testing.

Why this project template is inconsistent with the above? Was there any specific design decision to omit TestClient in the backend tests and use Requests instead? 🤔

I made a fork where I successfully integrated TestClient, so if you want I will create PR.

@StephenBrown2
Copy link
Contributor

Not the author/maintainer, so I can't say with authority, but PRs are probably welcome. :-)

@Toreno96
Copy link
Author

Not the author/maintainer, so I can't say with authority, but PRs are probably welcome. :-)

I suppose so, but before I create the PR, I would like to know this 😄:

Why this project template is inconsistent with the above? Was there any specific design decision to omit TestClient in the backend tests and use Requests instead?

@paul121
Copy link

paul121 commented Feb 18, 2020

My understanding is that all of the @tiangolo cookie-cutter repos are ideally kept in "sync" as much as possible. So modifying the tests for the full-stack repo means modifying tests on all of the other FastAPI cookie-cutters.

But that doesn't mean a PR isn't welcome to start that process and let others see how you've implemented @Toreno96 ! This would be very useful 😄

@tiangolo
Copy link
Member

Thanks for the help here everyone!

So, yes, I would like to have the tests using the TestClient, and in fact, get rid of the extra testing container.

It is set up this way because this project generator inherited a lot of the code from my previous project generator for Flask (predating FastAPI).

@hardbyte
Copy link

hardbyte commented Apr 6, 2021

I believe this is fully addressed by #160 and can be closed.

@Toreno96
Copy link
Author

Toreno96 commented Apr 7, 2021

I believe this is fully addressed by #160 and can be closed.

That's true, thanks for the reminder. I'm closing the issue.

@Toreno96 Toreno96 closed this as completed Apr 7, 2021
alejsdev pushed a commit that referenced this issue Dec 19, 2024
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v2...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants