I appreciate the reply that points out that you changed the type of n in a way that would indeed be caught by a compiler in a statically typed language.
On the unit testing, I could agree with that in a professional environment, but one of the key arguments for Python in introductory programming is that it is "simpler". What you are saying is that people teaching CS1 with Python absolutely must include unit testing in the course. That's an additional topic that I don't think most people currently have in CS1. (I cover it in CS2). These types of additions make it so that proper usage of these languages really isn't simpler than the statically-typed alternatives.