I'm trying in my tests to simulate a situation where a sender calls a payable method of a contract but does not have enough balance. A sample code would be:
with brownie.reverts():
contract.buy({'from': accounts[0], 'value': 100000000000000000000000000})
Instead of the test continuing I get a ValueError:
E ValueError: sender doesn't have enough funds to send tx. The upfront cost is: 100000000000000000000000000 and the sender's account only has: 100000000000000000000
How do I catch such errors with brownie?