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 yselivanov
Recipients Petter S, asvetlov, pdxjohnny, r.david.murray, yselivanov, zach.ware
Date 2018-03-08.01:47:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1520473656.38.0.467229070634.issue32972@psf.upfronthosting.co.za>
In-reply-to
Content
> I'm really not seeing what a separate class buys you.

I already mentioned in my previous comments that adding async support to unittest.TestCase would require us to add a metaclass to it, which is potentially a backwards incompatible change.

Moreover, I'm not even sure that `AsyncioTestCase` should be in the unittest module and not in asyncio.  Any non-trivial async package I've worked with usually requires quite a complicated setup to prepare an async test environment.  Usually a test case needs to test against different event loop policies or different event loops.  Which means that we need to support asynchronous versions of setUp, setUpClass, etc.  And I'm not sure we should just detect when they are asynchronous, perhaps we should make a set of new methods: asyncSetUp, asyncSetUpClass, etc.  This is something that needs more discussion.

So far I see that two core asyncio devs are against the proposed idea of changing unittest.TestCase to support async transparently.  IMO it gives almost no benefits but will complicate the implementation of TestCase and TestRunner (which are already quite hairy).
History
Date User Action Args
2018-03-08 01:47:36yselivanovsetrecipients: + yselivanov, r.david.murray, asvetlov, zach.ware, pdxjohnny, Petter S
2018-03-08 01:47:36yselivanovsetmessageid: <1520473656.38.0.467229070634.issue32972@psf.upfronthosting.co.za>
2018-03-08 01:47:36yselivanovlinkissue32972 messages
2018-03-08 01:47:34yselivanovcreate