In the proof of the variational method to estimate the ground state energy of a system, that is $$ \newcommand{\ket}[1]{\lvert{#1}\rangle} \newcommand{\bra}[1]{\langle{#1}\rvert} \newcommand{\braket}[2]{\langle{#1}|{#2}\rangle} E_0\le \frac{\bra{\psi}H\ket{\psi}}{\braket{\psi}{\psi}} $$ for any $\ket{\psi}$, I always read that we "ignore the presence of a continuous spectrum" and pretend that the eigenstates associated to the discrete eigenvalues form a complete basis, i.e. $$ \sum_n\ket{n}\bra{n}=1 $$ and go on expanding $\ket{\psi}$ as a linear combination of these $\ket{n}$ states.
I encountered, however, in some exercises some potentials that do not even have an infinite number of eigenstates, let alone a complete set, e.g. finite rectangular wells in one dimension, or the potential $$ V(x)=-\frac{\hbar^2}{ma^2\cosh^2(x/a)} $$ which has just one bound state.
In these cases and similar ones the assumptions for the variational method don't hold, so is that theorem always valid (but the proof is different) or do I have to check that indeed a complete set of eigenfunctions exists associated to the discrete spectrum?