How do I pass emmision test?

So I have a Honda Civic ek hatch with d16y7 engine and it's straight piped which means it's missing o2 sensor causing the check engine light on and I need to get plates for it what's the best way to get around this? The exhaust has no cat

If it is not a diesel, you put the cat back into the system.
You take the test, if you pass, then you are gold.
If you fail, you have 30 days to repair, and retest.

There's no way around it. You will have to get whatever is causing the light repaired, or you need to find out how to disable the light.

Just read and write

You will need to reinstall the catalyst and O2 sensors. The vehicle won't pass without them.

Your won't pass a smog inspection with a missing catalytic converter and O2 sensor. You'll have to put it back in factory original condition, and THEN make certain that everything is working properly BEFORE you take it in to get smogged.

If it's OBD2, then the only way you're passing is to get a cat and O2 sensor on it, take the test, then take them back off.

It will have to conform to emission laws for your state in any event. To my know, catalytic converters are required equipment in all states, and without proper computer control, may not pass the sniffer test.
California has the toughest laws, vehicles under 20 years old must be equipped exactly as factory standard for California.
That means any mod at all is a fail. Cars over 20 years may need a classic waiver, but still has to pass certain inspections.

Quit being cheap and buy the part. Its better to have a car then not and you definitely don't want a ticket

Re install the legal emission control equipment or face the consequences. (No registration or tags)