You can get a
cheap (around $20) OBDII scan tool from Amazon that you can plug into the OBDII port under the dash (usually on the driver's side) that will tell you the status of all the OBDII I/M Readiness Monitors that the particular vehicle you're looking at supports. If any of these I/M Readiness Monitors show up as being "Not Ready" on the scan tool, then that's a tipoff that someone reset the Check Engine light (either by disconnecting the battery or using a scan tool to do the deed).
I just went through this today after replacing the Flex Fuel module on my mom's 2005 Ford Taurus to fix the gas gauge (the Check Engine light was also on). I used the scan tool I referenced above to clear the Check Engine light after replacing the Flex Fuel module. I drove the car around for a while until all but the EVAP I/M readiness monitor went to Ready. I was even able to get it to pass the Ohio E-Check today with that one readiness monitor still in Not Ready status (here in Ohio they now have self-service kiosks that you can go up to and plug their monitor into your car's OBDII port and get your E-Check certificate).
EDIT: I got to thinking... there's also the possibility that the seller of the vehicle in question could have reset the Check Engine light and did a
drive cycle to get all of the I/M Readiness indicators to go to Ready status, and you test drive the vehicle during a small window between when all of the I/M readiness indicators show Ready and the Check Engine light comes back on. Or maybe the Check Engine Light would come back on before all of the readiness indicators show Ready if the problem that caused the CEL to light still hasn't been fixed?