在假設隨機抽樣,有一個corresponding sampled_from() strategy到random.choice(): In [1]: from hypothesis import find, strategies as st
In [2]: find(st.sampled_from(('ST', 'LT', 'TG', 'CT')), lambda x: True)
Out[2
我使用python假設像下面 @st.composite
def generate_network_fault_only(draw):
fault = {
"impaired": st.just(True), # need to detect if all faults are None to switch this back.
"limit": draw(Ne