Message343183
I tried using AsyncioDocTestRunner that inherits from DocTestRunner and most of the current DocTestRunner is synchronous and the execution happens in __run that seems to cause problem due to name mangling inheriting and changing it. Also python -m doctest by default uses testmod/testfile that use DocTestRunner so I thought to change DocTestRunner would be simpler and existing code can use added doctest flag without changing runner.
To be little more clear by each line I meant each example. So in below "async with session.get(url) as resp:\n text = await resp.text()" counts as a single example whose code object is evaluated in asyncio.run which I said as per line by mistake.
>>> async with session.get(url) as resp:
... text = await resp.text()
Your concerns are reasonable about asyncio.run per example seem to be over kill and might not work in few cases. I also didn't think about trio. I will look into those. Thanks for the pointers. |
|
Date |
User |
Action |
Args |
2019-05-22 11:56:31 | xtreak | set | recipients:
+ xtreak, njs, asvetlov, yselivanov, mbussonn |
2019-05-22 11:56:31 | xtreak | set | messageid: <1558526191.83.0.834354032791.issue37006@roundup.psfhosted.org> |
2019-05-22 11:56:31 | xtreak | link | issue37006 messages |
2019-05-22 11:56:31 | xtreak | create | |
|