Closed fkromer closed 5 years ago
@fkromer: we can pass additional arguments by keyword, where each keyword corresponds to column name. E.g. if we want user_id
to be from range between 0
and 1000
this can be done like
>>> from hypothesis import strategies
>>> from hypothesis_sqlalchemy import tables
>>> custom_columns = {user_table.c.user_id.name: strategies.integers(0, 1000)}
>>> records = tables.records.factory(user_table,
**custom_columns)
>>> records.example()
(155, '(*)', None, '.)#Gpz')
@lycantropos Thx a lot for the hint. BTW: Great package.
It is not clear to me how to customize strategies that they generate customized tables and records. Given your records usage example: How could I generate values for
user_id
in a customized range of integer values, let's say between0
and1000
?