It depends on the price of the house and the cost to fix the problem.
And by fixing the problem, I mean doing it properly and correcting whatever led to the mold problem in the first place.
So: If the property after repairs would be worth $300,000, the mold remediation and correction would cost $40,000, and I could buy it for $100,000, then, sure, I'd buy it. On the other hand, if I had to pay $250,000 for the same house, then, no, I wouldn't buy it.
Hope that helps.