Tests: at the beginning or the end of class?
For all the reasons you give, the first hour is much better. Just make sure that they are told beforehand (previous day) there won't be an adjustment made for late comers. They will likely be coming to class "psyched" for the exam. The intervening lecture will get in the way of that. The material discussed might even, being the most recent, be what sticks in their heads during the exam, rather than the material tested. They will also be more likely to ignore or forget the material in the lecture. But you say something similar yourself. 

But why do you have to give a one hour test every three weeks. Is that a rule imposed on you? Suppose you start each class with a 15 minute quiz that covers recent material (not just the previous day). Would that be acceptable? It makes each exam less consequential overall and gives you better up to date information about what they have learned. If you end the previous session with a five minute review, perhaps led by the students themselves, on what are the "big ideas" today, and then base the quiz on those ideas (primarily), you may turn out to be more effective.