  Given a finite-valued sample $X_1,...,X_n$ we wish to test whether it was
generated by a stationary ergodic process belonging to a family $H_0$, or it
was generated by a stationary ergodic process outside $H_0$. We require the
Type I error of the test to be uniformly bounded, while the type II error has
to be mande not more than a finite number of times with probability 1. For this
notion of consistency we provide necessary and sufficient conditions on the
family $H_0$ for the existence of a consistent test. This criterion is
illustrated with applications to testing for a membership to parametric
families, generalizing some existing results. In addition, we analyze a
stronger notion of consistency, which requires finite-sample guarantees on
error of both types, and provide some necessary and some sufficient conditions
for the existence of a consistent test. We emphasize that no assumption on the
process distributions are made beyond stationarity and ergodicity.
