Interview Prep/Python for DevOps/Testing, CI/CD, packaging & services

You join a team whose Python automation repo has no tests. Where do you start?

BeginnerScenarioTesting, CI/CD, packaging & services
Answer

Situation read → Untested code that touches infrastructure.

What I'd do →

  1. Add pytest, ruff and mypy to CI first, even with few tests, so the bar can only go up.
  2. Write tests for the most destructive scripts first (cleanup, deletion), using moto and dry-run assertions.
  3. Add a test with every bug fix that reproduces the bug.
  4. Refactor big scripts into pure functions as you touch them.

Why → Risk-first testing gives the most protection per hour.

Interview tip → "Test the scripts that delete things first."

All Python for DevOps questions Roadmap: Python for automation

More on Testing, CI/CD, packaging & services