replace python asserts with test asserts