Why sex evolved and persists is a problem for evolutionary biology, because sex disrupts favourable gene combinations and requires an expenditure of time and energy. Further, in organisms with unequal-sized gametes, the female transmits her genes at only half the rate of an asexual equivalent (the twofold cost of sex). Many modern theories that provide an explanation for the advantage of sex incorporate an idea originally proposed by Weismann more than 100 years ago: sex allows natural selection to proceed more effectively because it increases genetic variation. Here we test this hypothesis, which still lacks robust empirical support, with the use of experiments on yeast populations. Capitalizing on recent advances in the molecular biology of recombination in yeast, we produced by genetic manipulation strains that differed only in their capacity for sexual reproduction. We show that, as predicted by the theory, sex increases the rate of adaptation to a new harsh environment but has no measurable effect on fitness in a new benign environment where there is little selection.