Recent observational and theoretical results suggest that the production rates and luminosities of high-mass X-ray binaries depend on metallicity. To test this prediction, we combine HMXB population synthesis results with numerical simulations of galaxy formation to produce synthetic populations of HMXBs in star-forming galaxies, and compare the model predictions to observations of HMXB populations in nearby and high-redshift galaxies. Our models show a fair agreement with observations only when the HMXB production and luminosities are assumed to depend strongly on metallicity.