This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author xtreak
Recipients asvetlov, mbussonn, njs, xtreak, yselivanov
Date 2019-05-22.11:56:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1558526191.83.0.834354032791.issue37006@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2019-05-22 11:56:31xtreaksetrecipients: + xtreak, njs, asvetlov, yselivanov, mbussonn
2019-05-22 11:56:31xtreaksetmessageid: <1558526191.83.0.834354032791.issue37006@roundup.psfhosted.org>
2019-05-22 11:56:31xtreaklinkissue37006 messages
2019-05-22 11:56:31xtreakcreate