Because of the relatively broad angular resolution of current gamma-ray instruments in the MeV-GeV energy range, the photons of a given source are mixed with those coming from nearby sources or diffuse background. This source confusion seriously hampers the search for pulsation from faint sources. It has been shown that statistical tests for pulsation can be significantly improved when the probability that a photon comes from the pulsar is used as a weight. However, the computation of this probability requires knowledge of the spectral model of all sources in the region of interest, including the pulsar itself. This is not possible for very faint pulsars that are not detected as gamma-ray sources or whose spectrum is not measured precisely enough. In this talk we present two methods that overcome this limitation. The first one approximates the source/background ratio yielding an estimate of the weight while the second one makes use of the full spatial and spectral information of the region of interest around the pulsar. In both methods, the lack of knowledge of the pulsar spectrum is compensated by performing an efficient scan in the spectral parameter space, with only a few trial parameter values.