Covid testing before labor

What happens if you test positive for covid before giving birth? I know they test the mothers before actually pushing. Even if you did, would they let you leave the hospital with your baby???