Maybe someone else here can correct me if I am worng, but I am of the impression (at least here in Missouri) that the only codes that will fail emmisions testing on OBDII are ones that cause the "service enigne soon" and or "service vehicle soon" to light up. Not all codes will cause a MIL to light up, as many codes are not powertrain or emissions related. Thus, the car may pass emissions if this is true, and the code you have doesn't set an MIL to an "ON" state.
Anyone else here know for sure? MY car is OBDI (thankfully) so none of this applies, and I passed emmissions through the mobile "sniffer" van that the state sets up here on highway on ramps, so I never had to go and get it tested.
I know that this program varies from state to state, so the ground rules may not be the same where you're at. Of course, the one thing that is true everywhere is that clearing the codes just prior to testing will tip off the testing station during the OBDII test and will automatically fail the car. There has to be a certain amount of history data stored for the test to proceed.