← All Playwright Python mock interview topics
Test your knowledge of pytest Fundamentals with a timed Playwright Python MCQ mock test. Each attempt gives you 20 random questions in 20 minutes from a 200-question bank covering test discovery, plain assert and assertion rewriting, pytest.raises and approx, test outcomes and exit codes, fixtures, yield teardown and scopes, conftest.py, parametrize, skip, skipif, xfail and custom markers, pytest.ini settings, plugins such as rerunfailures, xdist and pytest-html, and hooks such as pytest_addoption and pytest_runtest_makereport. Submit to see your score, the correct answers and an explanation for every question.
What this mock test covers
The questions follow Module 3 of the free Playwright with Python & Pytest tutorial. Revise these lessons if a question catches you out:
- pytest Basics: Test Discovery, assert and Running Tests
- pytest Fixtures: Setup, Teardown, Scope and yield
- Sharing Fixtures with conftest.py
- Parametrize Tests with @pytest.mark.parametrize
- pytest Markers: skip, skipif, xfail and Custom Markers
- pytest Configuration: pytest.ini, pyproject.toml and addopts
- pytest Plugins and Hooks: pytest_addoption and More
Sample questions with answers
- Q. Which file will pytest collect by default?
Answer: test_cart.py
pytest collects files named test_*.py or *_test.py. - Q. Which file name pattern does pytest also collect besides test_*.py?
Answer: *_test.py
Both test_*.py and *_test.py are default patterns. - Q. Which function is collected as a test?
Answer: def test_total():
Functions must start with test. - Q. Which class is collected by default?
Answer: class TestCart: with no __init__
Test classes start with Test and must not define __init__. - Q. How do you check a value in a pytest test?
Answer: With a plain assert statement
pytest uses plain assert and rewrites it for detailed messages.
Ready for more? Go back to the Playwright Python mock interview dashboard to track your overall interview readiness.
Frequently asked questions
How many questions does the pytest Fundamentals mock test have?
The question bank has 200 questions. Each test picks 20 at random, favouring questions you have not seen, so about 10 attempts cover the full bank.
What is the pass mark?
You pass a test with 70% or more, which is 14 of 20 questions correct.
Can I retake the test?
Yes. Retake as often as you like. Every retake draws a fresh set of 20 questions and counts toward your 20-exam readiness target.