We studied the function of learning in the parasitoidLeptopilina heterotomaby looking at discrimination of odour stimuli used in foraging for a host. To optimize the rate of encounters with hosts, these parasitoids are expected to assess the extent to which variation in host–substrate odours is reliably associated with variation in the presence of hosts, that is, substrate profitability. Where the association is reliable, parasitoids should attend to variation in odours and discriminate between them; where it is not, they should ignore it. We hypothesized that foraging decisions are based on the completeness of information the animal has about differences in substrate profitabilities. Our laboratory studies showed that discrimination and non-discrimination of odour stimuli are dynamic behavioural decisions that can be related to the degree of substrate variation and to an animal's informational state. In wind-tunnel studies, females learned to discriminate between odours from substrates that were qualitatively different, for example, between odours from apple and pear substrates or between yeast substrates with different C6compounds added. They did not discriminate when differences were small (e.g. between odours from two apple varieties or between yeast patches with different concentrations of ethyl acetate), unless unrewarding experiences provided evidence of the absence of hosts in one of the substrates. Hence, we suggest that non-discrimination between odour stimuli inL. heterotomais not a lack of ability to discriminate but a functional decision by the parasitoid.