Tests: Only import modules if they are needed for test