Message313438
> 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:
https://gist.github.com/PetterS/f684095a09fd1d8164a4d8b28ce3932d
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:01 | Petter S | set | recipients:
+ Petter S, r.david.murray, njs, asvetlov, zach.ware, yselivanov, pdxjohnny |
2018-03-08 13:13:01 | Petter S | set | messageid: <1520514781.95.0.467229070634.issue32972@psf.upfronthosting.co.za> |
2018-03-08 13:13:01 | Petter S | link | issue32972 messages |
2018-03-08 13:13:01 | Petter S | create | |
|