What does the AAA pattern stand for in unit testing?
Pcet Fundamentals Category
Question · Easy
In the testing pyramid, which layer should have the MOST tests?
Which of the FIRST principles requires that tests can run in any order?
Tech Exam Prep Podcast
Listen on Spotify
Podcast
Which method is called BEFORE every test method in a unittest.TestCase subclass?
Pcet Unittest Category
Which unittest assertion verifies that two values are equal?
Which assertion confirms that a specific exception is raised when calling a function?
Question · Medium
Which assertion compares two floating-point numbers within a tolerance?
Which decorator unconditionally skips a unittest test method?
Which decorator marks a test that is expected to fail (and reports a real pass as 'unexpected success')?
Question · Hard
Which command runs unittest test discovery from the project root?
Which method runs ONCE before all tests in a TestCase class?
In pytest, how do you write an assertion?
Pcet Pytest Category
What does the @pytest.fixture decorator do?
In pytest, what is the DEFAULT scope of a fixture?
Which fixture scope creates ONE instance shared across the entire pytest run?
How do you write a fixture that yields a resource and cleans it up after the test?
Which pytest decorator runs the same test function with multiple input/expected pairs?
What is conftest.py used for in pytest?
Which pytest CLI flag stops on the first failure?
Which pytest CLI flag selects tests by name substring?
Which pytest CLI flag selects tests by mark?
Which built-in pytest fixture creates a unique temporary directory per test?
Which built-in pytest fixture lets you safely modify environment variables, attributes, or imports for one test?
Which pytest fixture captures stdout and stderr?
How do you assert that a function raises an exception in pytest?
Which configuration file is the canonical pytest config?
What does the unittest.mock.Mock() class do?
Pcet Mocking Category
What is the difference between Mock and MagicMock?
Which call replaces 'requests.get' with a Mock for the duration of one test function (using a decorator)?
What does setting `mock.return_value = 42` do?
What does `mock.side_effect = ValueError('boom')` do?
Which mock method asserts that a mock was called exactly once with specific arguments?
In test-double terminology, what is a STUB?
In test-double terminology, what is a FAKE?
In test-double terminology, what is a SPY?
When patching with mock.patch, which target should you use to replace `requests.get` USED inside `myapp.api`?
Which command produces a code coverage report when running pytest with the pytest-cov plugin?
Pcet Coverage Category
What does branch coverage measure that line coverage does NOT?
Which Selenium method finds an element by its id attribute?
Pcet Selenium Category
Which Selenium pattern waits up to 10 seconds for an element to be visible?
Which Selenium method types text into an input field?
In BDD with behave, which Gherkin keyword describes the action a user takes?
Pcet Bdd Category
In behave or pytest-bdd, where do .feature files live by convention?
Which Python library is the de-facto standard for HTTP requests in API testing?
Pcet Api Testing Category
Which assertion checks that an HTTP response was successful (2xx)?
Which Python testing library focuses on load and performance testing with Python-defined user behavior?
Which pytest fixture scope shares the fixture across all tests in the same class?
Loading more…