Open jcassee opened 6 years ago
Because of the operator precedence in Python and some inherent complexity with lazy evaluation in such case, it's not currently possible using >
yield test subject operator in conditional composition. I think I can find a way to make it work, but I can't spend time on that right now.
The recommended style here that actually works is using the yield chain operator instead:
{1: {2: 3}} | should.have.key(1) > should.any(
should.have.key(2).that.should.be.equal(3),
should.have.key(2).that.should.be.empty)
Thanks, Tomás, I can use that.
Not sure if this is expected to work, but I had hoped to combine composition and conditional operators: