В Thu, 28 Jul 2022 23:43:31 -0700
Zac Hatfield Dodds <
zac.hatfi...@gmail.com> пишет:
> The example doesn't - to my sensibilities - save enough code to have a net-lower cognitive burden than writing the Python test code directly.
Hi! I've figured out more logical and compact syntax:
@given_divided(
name={
'empty': {
'raises': {
'err': TypeError,
'pattern': '^Name'
},
'values': text(max_size=0)
},
'non-empty': text(min_size=1)
},
role=text(),
...
}
As compared to the previous one, there is no need to duplicate
parameter names and for simple categories it is possible to
directly specify the desired strategy. Simple (i.e. non-subdivided)
values are also possible.