For fluids in a periodic potential the grand-canonical potential per unit volume (negative ``thermodynamic pressure'') differs from the diagonal components of the average stress tensor. This is in contrast to homogeneous fluids. The thermodynamic meaning and the microscopic origin of this difference are discussed within the framework of classical statistical mechanics. For one-dimensional hard rods and for an ideal gas of diatomic molecules the two quantities are calculated exactly. General expressions are derived in a cluster expansion which can be applied to low-density classical fluids with more realistic interactions.