Here in NY, they actually hook your vehicle up to the OBDII sensor port and scan the computer for error codes and transmit the data to Albany to be stored with your vehicle information. So you can't just try and take it somewhere else to get it to pass.
Case in point. If you store your vehicle(s) for the winter and take the battery out, you must drive it 50-100 miles before getting it inspected. It has to have so much data in the computer and/or all the systems online to PASS. Mine failed the first time out of storage, drove it a few days and took it back, no problems.
Normally after fixing the problems, the light should go out after 20-50+? miles....
NY does that, since many people will just try and diconnect the battery, clear the codes/check engine lights and take it to a service station quick to get it to pass...WRONG. Since the emissions systems take a while to collect data, that is why it doesn't work, if the systems are NOT online, even though there is no check engine light, you can still fail!