Recall & Review
beginner
What is a pytest plugin?
A pytest plugin is an add-on that extends pytest's features, like adding new commands or hooks to customize test runs.
Click to reveal answer
beginner
How do you install a pytest plugin?
You install a pytest plugin using pip, for example:
pip install pytest-plugin-name.Click to reveal answer
intermediate
How can you check which pytest plugins are currently installed?
Run
pytest --trace-config in the terminal to see all active plugins and their configurations.Click to reveal answer
intermediate
What is the purpose of the
pytest_plugins variable in a test file?It tells pytest which plugins to load for that test file, allowing selective plugin usage.
Click to reveal answer
beginner
How do you uninstall a pytest plugin?
Use pip to uninstall it, for example:
pip uninstall pytest-plugin-name.Click to reveal answer
Which command installs a pytest plugin named 'pytest-cov'?
✗ Incorrect
Use pip to install pytest plugins, so the correct command is
pip install pytest-cov.How do you list all active pytest plugins?
✗ Incorrect
The command
pytest --trace-config shows all active plugins and their configurations.What file or variable can specify plugins to load for a test session?
✗ Incorrect
The
pytest_plugins variable in test files specifies which plugins to load.Which tool manages pytest plugin installation and removal?
✗ Incorrect
pip is used to install and uninstall pytest plugins.
If a plugin is not working after installation, what is a good first step?
✗ Incorrect
Checking active plugins with
pytest --trace-config helps verify if the plugin loaded correctly.Explain how to install, verify, and uninstall a pytest plugin.
Think about commands for adding, checking, and removing plugins.
You got /3 concepts.
Describe the role of the pytest_plugins variable and when you might use it.
Consider how to control plugin loading per test file.
You got /3 concepts.