POC Testing & Quality Assurance Flashcards
6 cards from real POC practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 6 POC Testing & Quality Assurance flashcards as text
Which Python tool is the standard for measuring code coverage during testing?
Answer: coverage.py
`coverage.py` is the standard Python tool for measuring code coverage and can produce detailed HTML reports.
What happens when a Python `assert` statement's condition evaluates to False?
Answer: It raises AssertionError
When an `assert` condition is False, Python raises an `AssertionError`, optionally with a custom message.
In pytest, which marker indicates that a test is expected to fail?
Answer: @pytest.mark.xfail
`@pytest.mark.xfail` marks a test as expected to fail; if it passes unexpectedly, it is reported as `xpass`.
What is parameterized testing in pytest?
Answer: Running the same test function with multiple different input values
Parameterized testing uses `@pytest.mark.parametrize` to run a single test function with multiple sets of arguments automatically.
What is the key difference between a unit test and an integration test?
Answer: Unit tests verify isolated components; integration tests verify multiple components interacting
Unit tests verify individual components in isolation, while integration tests verify that multiple components work together correctly.
What is the purpose of `MagicMock` in Python's `unittest.mock` module?
Answer: To create mock objects that also support magic (dunder) methods
`MagicMock` is a subclass of `Mock` that pre-configures support for Python magic methods like `__len__`, `__str__`, and `__iter__`.