How does an engine failure affect the flight of an airplane?
It does.  Asymmetric thrust will in fact force the airplane into a turn unless the pilot counteracts this by using rudder and aileron to command an equal turn force in the other direction.  Typically both opposing rudder, and banking away from the dead engine will be used to result in straight (although uncoordinated) flight.