The characteristic feature of the so-called Painleve test for integrability of an ordinary (or partial) analytic differential equation, as usually carried out, is to determine whether all its solutions are single-valued by local analysis near individual singular points of solutions. This test, interpreted flexibly, has been quite successful in spite of various evident flaws. We review the Painleve test in detail and then propose a more robust and generally more appropriate definition of integrability: a multivalued function is accepted as an integral if its possible values (at any given point in phase space) are not dense. This definition is illustrated and justified by examples, and a widely applicable method (the poly-Pain/eve method) of testing for it is presented, based on asymptotic analysis covering several singularities simultaneously.