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 Petter S
Recipients Petter S, asvetlov, njs, pdxjohnny, r.david.murray, yselivanov, zach.ware
Date 2018-03-08.13:13:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> No, it shouldn't break them if you wrap async methods carefully.
> Here's a metaclass that I wrote recently doing just that

That code does not seem to work for me:
I get "RuntimeWarning: coroutine 'test_async_with_mock' was never awaited"

@mock.patch needs to work correctly for test methods.

>> 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.

No, unittest.TestCase can handle this, as demonstrated by two PRs in this bug. This would not change the behavior of existing (working) code.
Date User Action Args
2018-03-08 13:13:01Petter Ssetrecipients: + Petter S, r.david.murray, njs, asvetlov, zach.ware, yselivanov, pdxjohnny
2018-03-08 13:13:01Petter Ssetmessageid: <>
2018-03-08 13:13:01Petter Slinkissue32972 messages
2018-03-08 13:13:01Petter Screate