This is a useful pattern even if it involves a bit of hacking to make it work.
a) notice some error with some URL
b) copy paste the URL and paste it into IPython REPL runner function
c) get a stack trace and %debug functionality locally that is as-close-as-possible to what happens in the backend.
d) importlib.reload and iterate until it works.
e) test for real through the REST api
I've got this working with other frameworks but am wondering if this already exists somewhere here since this framework seems to already have the best of everything.
There is this debugging functionality but not sure how that hooks in with a vanilla IPython runner:
https://fastapi.tiangolo.com/tutorial/debugging/#run-your-code-with-your-debugger
For example, maybe there is an error handling pattern where the full stack trace is sent and can be reconstructed in the REPL.
Actually I wouldn't know.
I use a lot of IPython (actually Jupyter Kernels connected to the editor, but more or less the same) to run small snippets directly from the code, but not with that style, I wasn't able to use it successfully with previous frameworks and make it useful for me, so I'm not sure what would be the best way to approach it.
Nevertheless, I think you could probably do it with the test client directly, which is more or less the same. It calls the app without making an actual HTTP server, etc.
So you could create a test client in your IPython environment with your app and call the URLs with it.
Another alternative would be with HTTPX: https://github.com/encode/httpx
As it allows calling directly an ASGI app: https://www.python-httpx.org/async/#calling-into-python-web-apps
Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues.
Most helpful comment
Actually I wouldn't know.
I use a lot of IPython (actually Jupyter Kernels connected to the editor, but more or less the same) to run small snippets directly from the code, but not with that style, I wasn't able to use it successfully with previous frameworks and make it useful for me, so I'm not sure what would be the best way to approach it.
Nevertheless, I think you could probably do it with the test client directly, which is more or less the same. It calls the app without making an actual HTTP server, etc.
So you could create a test client in your IPython environment with your app and call the URLs with it.
Another alternative would be with HTTPX: https://github.com/encode/httpx
As it allows calling directly an ASGI app: https://www.python-httpx.org/async/#calling-into-python-web-apps