Message332968
The ``ANY`` object in ``unittest.mock`` is also pretty useful when verifying dicts in tests:
self.assertEqual(result, {
"message": "Hi!",
"code": 0,
"id": mock.ANY
})
Then it does not matter what the (presumably randomly generated) id is. For the same use cases, objects like ``APPROXIMATE`` (for approximate floating-point matching) and ``MATCHES`` (taking a boolean lambda) would be pretty useful, I think. |
|
Date |
User |
Action |
Args |
2019-01-04 11:04:54 | Petter S | set | recipients:
+ Petter S |
2019-01-04 11:04:51 | Petter S | set | messageid: <1546599891.86.0.0577370914139.issue35656@roundup.psfhosted.org> |
2019-01-04 11:04:51 | Petter S | link | issue35656 messages |
2019-01-04 11:04:51 | Petter S | create | |
|