Skip to content

Commit

Permalink
test: simplify variablecollection generation to speed up generation s…
Browse files Browse the repository at this point in the history
…ome more – allow shrinking of ivs, dvs and covariates together
  • Loading branch information
hollandjg committed Nov 22, 2023
1 parent 50dd66a commit 901253f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/test_strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,13 @@ def variablecollection_strategy(
if num_variables is not None:
n_ivs, n_dvs, n_covariates = num_variables
else: # num_variables is None
n_ivs = draw(st.integers(min_value=1, max_value=max_length))
n_dvs = draw(st.integers(min_value=1, max_value=max_length))
n_covariates = draw(st.integers(min_value=0, max_value=max_length))
n_ivs, n_dvs, n_covariates = draw(
st.tuples(
st.integers(min_value=1, max_value=max_length),
st.integers(min_value=1, max_value=max_length),
st.integers(min_value=0, max_value=max_length),
)
)

n_variables = n_ivs + n_dvs + n_covariates

Expand Down

0 comments on commit 901253f

Please sign in to comment.