Skip to course content
Free FastAPI backend course

FastAPI for AI Backend Development

Module 09 Knowledge Check

5 questions. Pass mark 4 out of 5. Answer every question before checking the answer key below, then retry after reading the feedback.

1. TestClient exercises…

2. A fixture that does not reset shared state produces…

3. After overriding a dependency in a test you must…

4. Which assertion is worth keeping?

5. The offline part of the suite should…

---

Answer Key and Explanations

Check these only after attempting every question.

1. B - routing, validation, dependencies, response models and errors

In-process, with no server and no port to bind.

2. B - tests that fail depending on order

And the failing test is rarely the one at fault.

3. B - clear the override

Overrides are global to the app object and silently affect later tests.

4. B - the response contains no unexpected fields

It catches an internal field leaking, which is what the response model exists to prevent.

5. B - run in seconds with no key

It is where model validation, endpoint contracts and service logic all live.

Practical Check

Apply this module to your own work: complete the module activity for *Testing FastAPI Endpoints with Fixtures*, then write one sentence naming what your result shows and one naming what it does not.

Strong Answer Pattern

A strong answer names the task, the evidence used, the check performed, and the remaining limitation. It avoids "proved", "guaranteed", or "always" unless the evidence genuinely supports it.