mercredi 1 mai 2019

list index out of range when performing database queries in Hypothesis function

I'm using Python Hypothesis to write random tests for database. After 1-2 loops of insert the given values to the table I get list index out of range and @seed to reproduce. There is nothing that suppose to fail, I'm not asserting anything yet. How can I debug this?

Thanks

        run_statement("create table t (x int)")
        @given(st.integers(1,10), st.integers(1,10))
        def insert_select(x):
            assume(x)
            run_statement("insert into t values ({})".format(x))
            select_results = run_statement_with_results("select * from t")
            print select_results

        insert_select()


results:

You can add @seed(257907719204305935240373390472712621009) to this test to reproduce this failure.
timeout
error: list index out of range

Aucun commentaire:

Enregistrer un commentaire