-
Notifications
You must be signed in to change notification settings - Fork 353
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
docs: add asyncio in multi-agent-applications.md to make examples can be run "as is". #630
Conversation
you'll need to use single quotes. Best to run tests before committing which will pick this up, if you run |
As I said before
|
😞 looks like a bug in pytest-examples we can't ignore, I'll try to fix it. |
Ok, thank you. I will wait for it. I will create an issue about it. |
#632 Have created an issue. |
Okay, I see what's going on here, the problem is caused by calling pydantic-ai/tests/test_examples.py Line 122 in 06eac85
Honestly I would rather keep the examples short and omit if __name__ == '__main__':
asyncio.run(main()) I think it's pretty obvious to most developers that you'll need to call _(This example is complete, it can be run "as is" — you'll need to add `asyncio.run(main())` to run `main`)_ to all examples that need it. |
Thank you for your help! A new PR #638 has been created. And I suggest to add |
Examples cannot be run "as is" without asyncio.