How to test your FastAPI application
Ғылым және технология
On this video, I talk about the different ways of testing your FastAPI application.
It's my first video, hope you like it!
Relevant links from the video:
- github.com/encode/httpx
- www.starlette.io/testclient/
- fastapi.tiangolo.com/tutorial...
- github.com/frankie567/httpx-ws
#fastapi #test #webframework #learning #programming
Пікірлер: 33
Nice video, I want us to start using FastAPI more at work. (The VSCode assistance is pretty amazing!) To help you get used to looking at the camera when you speak, put a little figure (a LEGO character will do) next to your camera, and talk to it. This will draw your eyes from the screen where you are coding to the camera, and your viewers will feel like you are talking to them more directly.
@fastapiexpert
Жыл бұрын
Thanks Paul! I'll do that! 😁🙏
Nice video, it is amazing to see u on youtube 🎉, i would suggest that you just try to make microservices and make them communicate with each other and show us the industry standars and we can go from there .. really excited to have u on youtube really
Thank you, please keep making more, I know very little and learning is fun about fastapi, starlette, pydantic
Thanks for the video, keep going, you have new subscriber!!
Thanks for sharing your knowladge.
An idea: to get into the architecture of Starlette, so people have a deeper understanding of what's going on under the hood. An approach I use to understand the internals of things, is to debug my way there, so could be that you inspect a request and explain what's happening end-to-end Internals talk is always helpful and usually inspiring Best! and thank you for sharing
@fastapiexpert
Жыл бұрын
Nice idea! I'm going to do it! :)
I'm learning FastAPI project for my company. Hope to you learn from you in the coming months. Subscribed!
great one.. thank you sir..
THANK YOU very insightful!!
Finally good test tutorial
Great video!
Great Thanks for sharing
great!
Excelente conteúdo! Parabéns! Muito legal ver BR decolando!
@fastapiexpert
6 ай бұрын
Obrigado David! :)
Nice start! Would you use Hypothesis framework with Fastapi? And what's the best way to test CRUD endpoints with async db connection. Should we stick to something simple like async SQLlite?
Anything and everything relating to API. Can you do a video of lessons learned or hidden feature sof fastapi that a beginner would not know, like yesterday I learned that order in which endpoints are placed matters, I am still learning as to how that happens. Thank you for sharing and teaching, appreciate it.
你太酷了!
Hello thanks for this video. I subscribed for your channel. All the best for you. I just want to ask you, please use a bigger font-size, because I am struggling to see the code editor. thanks again 💐
great stuff. whats the theme and whats the copilot extension name?
Trying to do it the async way I get an error: "TypeError: 'AsyncClient' object does not support the context manager protocol"
Hi. I have been trying find out a specific thing about testing a FastAPI application in the last week, with no sucess. Maybe someone here can help me?: At what point is the server actually started, like it would normally with f.e. "hypercorn app:main"? Is this part of the TestClient (and also the AsyncClient)? I need to integrate a restart of the server into the test. If I am misunderstanding something, please let me know aswell!
hello, thanks for your content , I have a question , could not find it regarding websockets, the server gives error failed ,403, I did many research , chatGDP etc but could not handle it , i was wondering if you can give me your own idea or tips :)
thx
Nice how about something hooking up fastapi, a db and pandas to process data and display a chart over several episodes
Hello. Great video, what's the name of this autocompletion extension?
@fastapiexpert
Жыл бұрын
I think you mean the GitHub copilot?
These examples with async tests work only with one endpoint - but with 2+ endpoint it's not working. Especially if you have many async endpoints and async client for connecting to DB (MongoDB in my case). I have (PytestUnhandledCoroutineWarning) and (RuntimeError: Event loop is closed) errors, trying many variants combinations installed modules. No one studies the correct way, even official documentation fastapi. All give one primitive example with "hello world". I propose next time to make multiprocessing demonstration tutorial with one thread example. Sorry. I've reached my limit.
Well, a feedback is: be more serious and structure with your videos, I see sometimes your thoughts are not direct. Also you didn't fix your exception at the end of the video, which makes me wonder about the worth of the whole video.
Why is this all so complicated? Why can we not just declare "async def test..." and it just ... works without fixtures, loops, plugins, with or without with? Testing is such a fundamental thing. It feels like it all just so fresh and not ready for a real production use 😢
great!