The idea of testing code was never covered in any of the introductory books I read. I learned the basics of C, Fortran, and Pascal while doing a physics undergrad in the 90's, then I learned Java and Python in the 00's on my own from books and websites. None of the introductory books I read introduced the concept of testing. It wasn't until I started reading programming blogs on a regular basis that I started writing tests for my code. Once I did, the quality of my code immediately improved and I felt much more confident in the code I wrote.
When I wrote an introductory Python text recently I included a chapter on the most basic aspects of testing. Beginners don't need to write tests for everything they write, but they should definitely be aware of the concept.