Test your pytest-flask knowledge with a free interactive quiz — 20 questions with answers and explanations. No signup needed to play.
Question 1/5Score 0
What does the `client` fixture provided by pytest-flask give a test function access to?
Questions in this quiz
What does the `client` fixture provided by pytest-flask give a test function access to?
Why might a pytest-flask test suite use parametrized tests (running the same test logic against multiple different input values) for validating a route's input handling?
What is a reasonable practice for keeping fixtures in a pytest-flask suite's `conftest.py` focused and well-scoped, rather than one giant fixture doing everything?
Why might a pytest-flask test suite mock or stub an external API call (rather than making a real network request) when testing a Flask route that depends on that external service?
What is a reasonable practice for resetting database state between individual tests in a pytest-flask suite that creates/modifies data during tests?
Why might a pytest-flask test verify a redirect response (like after a successful form submission) by checking both the status code and the `Location` header, rather than only following the redirect automatically?
How might a pytest-flask test verify that a route correctly requires authentication, rejecting an unauthenticated request?
Why might a test database (separate from the actual development or production database) commonly be configured in the `app` fixture for a pytest-flask test suite involving database access?
Why might CI (continuous integration) commonly run the full pytest-flask test suite automatically on every pull request?
What is a general reason integration-style tests (via pytest-flask's test client) and lower-level unit tests (testing individual functions in isolation) are often used together in a Flask project, rather than relying on just one type?
What is pytest-flask?
Why is testing an application via its HTTP test client (as pytest-flask facilitates) valuable, compared to only unit-testing individual functions in isolation?