0
0
PyTesttesting~5 mins

Installing and managing plugins in PyTest - Quick Revision & Summary

Choose your learning style9 modes available
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'?
Apip install pytest-cov
Bpytest install pytest-cov
Cpip pytest install cov
Dpytest --install pytest-cov
How do you list all active pytest plugins?
Apytest --trace-config
Bpytest --list-plugins
Cpip list pytest-plugins
Dpytest --show-plugins
What file or variable can specify plugins to load for a test session?
Apytest.ini
Bsetup.cfg
Crequirements.txt
Dpytest_plugins variable
Which tool manages pytest plugin installation and removal?
Apytest
Bpip
Cvirtualenv
Dtox
If a plugin is not working after installation, what is a good first step?
ARestart the computer
BDelete the test files
CRun <code>pytest --trace-config</code> to check if the plugin is active
DReinstall Python
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.