I have an attrs class:
@attr.s
class Example:
my_int = attr.ib(validator=attr.validator.instance_of(MyComplexType))
I need to mock this validator.
Since everything after initialization is baked and immutable, mocking is not gonna work I think. However you you can temporarily disable validators using attr.set_run_validators().
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With