Message ID | 20210512174318.59466-1-mreitz@redhat.com (mailing list archive) |
---|---|
Headers | show |
Series | iotests/297: Cover tests/ | expand |
On 12.05.21 19:43, Max Reitz wrote: > v1: https://lists.nongnu.org/archive/html/qemu-block/2021-03/msg01471.html > > > Hi, > > When reviewing Vladimir’s new addition to tests/, I noticed that 297 so > far does not cover named tests. That isn’t so good. > > This series makes it cover them, and because tests/ is rather sparse at > this point, I decided to also fix up the two tests in there that don’t > pass pylint’s scrutiny yet. I think it would be nice if we could keep > all of tests/ clean. > > > v2: > - Changed patch 2 as per Vladimir’s suggestion > (i.e. don’t let discards1_sha256 and all_discards_sha256 be class > variables at all) Thanks for the review, applied to my block branch: https://github.com/XanClic/qemu/commits/block Max
On 14.05.21 13:02, Max Reitz wrote: > On 12.05.21 19:43, Max Reitz wrote: >> v1: >> https://lists.nongnu.org/archive/html/qemu-block/2021-03/msg01471.html >> >> >> Hi, >> >> When reviewing Vladimir’s new addition to tests/, I noticed that 297 so >> far does not cover named tests. That isn’t so good. >> >> This series makes it cover them, and because tests/ is rather sparse at >> this point, I decided to also fix up the two tests in there that don’t >> pass pylint’s scrutiny yet. I think it would be nice if we could keep >> all of tests/ clean. >> >> >> v2: >> - Changed patch 2 as per Vladimir’s suggestion >> (i.e. don’t let discards1_sha256 and all_discards_sha256 be class >> variables at all) > > Thanks for the review, applied to my block branch: > > https://github.com/XanClic/qemu/commits/block ...and dropping again, patch 3 embarrassingly breaks migrate-bitmaps-test. The problem seems to be that contrastingly to pylint’s opinion, the `lambda self: mc(self)` is necessary, it can’t be contracted to just `mc`. I suspect that `mc` (returned by `methodcaller`) has a variable argument list, and so without the lambda, `setattr` adds it as a argument-less function, so when it is called, it doesn’t receive the `self` parameter. (It complains that it expected 1 argument, but got 0.) So we need the lambda to enforce that the `self` parameter is passed. Max