Fix cycles test to assert for RuntimeError