Pre Purchase Inspection

When buying a used car from a dealer, who preforms the pre purchase inspection? My mechanic or theirs? Thank you in advance.