If your vehicle engine light is on it has a code stored in the computer and something in the electronics is malfunctioning. You can remove the battery cable and put it back on after about a minute, or remove the ECM fuse from the fuse panel and put the fuse back in. If there is a problem though, this will not cure it and the light will come back on. You need to take the vehicle to a mechanic and have a scan run on the vehicle to know for sure what the problem is. There is a code stored in the computer of the vehicle.
Good answer bwtsrl - If the light does stay on after trying those things, there is no way to avoid getting it fixed before passing inspection. Even if you "know someone" that works at a shop, there is nothing they can do to bypass it, everything is computer generated now. Unfortunately, the most common cause of the check engine light coming on would be a sensor of some kind, and they can be pricey. Oh! One other thing that it could be - with newer cars, they can detect if your gas cap is not sealed tightly enough, check that before trying the battery, etc. Good luck with it!
Go to autozone