Logging, Testing & Reliability Coding Clinic.
Eight real Python challenges where you implement logging behavior, protect secrets, write unittest cases, inject failure scenarios, and keep reports safe when retries or API validation fail.
Test the failures, not only the happy path. The workbench executes Python in its isolated browser environment with fictional data. The mock clients do not contact a service; no access tokens or customer records are involved. Run experiments with your own code; Check uses the example plus additional test cases, including unsuccessful outcomes and preservation of previous reports.
The local unittest assignment shows how to run the same habits from your own Python project, including verifying a failing test can fail.
Write it. Run it. Understand it.
Implement safe logging, unittest assertions, injected mock failures, bounded retries and deterministic report recovery in real Python.
Choose meaningful logging severity
Write event_level(kind) using Python's logging module, returning the integer logging level for start/complete (INFO), retry (WARNING), and failed (ERROR). Return None for unknown event names. Do not configure handlers or print inside the helper. Print the three level names for the sample. The grader changes event order and checks that a failed operation is not logged as INFO.
INFO,WARNING,ERRORTry solving it before asking for help. Hints never show a completed program.
Your printed output and errors will appear here.
Run the code, then step through the executed lines to watch variable values change.
