This has nothing to do with tests. Tests would catch this, but so would sensible development practices like running your code at least once before deploying it.
That would catch the SyntaxError instances he mentioned but certainly not every case of AttributeError or ValueError exception. Even good testing would not catch all of them.
Indeed, regression tests are not a silver bullet. It's a patch for dynamic type system.
In this case I believe it was a dynamic import of a module that was not used in local development. Reasonable tests would have caught this.
Possibly, though it is just as likely that the tests would still not catch the problem in a local dev environment if that module is not used there, right?
To avoid problems like that, you probably want your dev environment as close as possible to your production environment. You probably also want to be testing your production specific code/logic (especially if you're not doing that on your local).