Discussion forum for David Beazley

Testing strategy for a curio application


#1

I’m trying to put together an rss to webhook type app for personal exploration of the curio library. I’m basing my small project off the pub/sub code in the curio tutorial. I’m wondering if anyone has some examples, advice, and/or general strategy for testing an async application using curio.

Currently, I’m trying to determine the best way to test the subscriber function. Since it waits on the queue indefinitely, I’m not exactly sure how to get a test around it. Maybe I’m just incorrectly looking at the situation. Any advice is appreciated. Thanks


#2

The testing strategy for async is an interesting challenge. I don’t have too much specific advice except that examples can be found in the test directory of Curio. I wouldn’t claim that these represent “best practice.” However, maybe it’s a starting point.


#3

Trio has fairly extensive test infrastructure in case you see anything you want to steal: pytest-trio, trio.testing