In support of MrDplus's reply:
I've flown to two countries that required a visa. In both instances, the airline required me to show the visa before allowing me to check bags and again before allowing me to board. I was told by a GA that the airline is fined by the foreign country if they allow a passenger on the flight without a proper visa.