Interview Prep/Python for DevOps/Testing, services & metrics

Why should automation scripts have tests at all?

BeginnerConceptTesting, services & metrics
Answer

Because infrastructure scripts are the code most likely to delete something important. Tests catch the cheap bugs (typo in a dict key, wrong filter, off-by-one on a date cutoff, missing pagination) before they run against production, let you refactor safely, and document the intended behaviour. With moto, tests for AWS logic run in seconds, offline, for free, so there is no excuse to test destructive scripts "live in dev and hope".

All Python for DevOps questions Roadmap: Python for automation

More on Testing, services & metrics