User:Arthurzam/Pytest Packages

From Gentoo Wiki
Jump to:navigation Jump to:search

A lot of python packages use dev-python/pytest for testing. This suite is great and very useful. But one of the quirks of testing with pytest are its plugins. On one hand, it improves testing facilities for developers, but on the other hand, pytest always auto loads all installed plugins, and they might conflict with each other or conflict with the current package for which tests are running.

Therefore, sometimes you need to add a disable plugin switch in the ebuild's python_test function. For example to disable dev-python/pytest-xdist, you can write:

python_test() {
    epytest -p no:xdist
}

But for using this option, you need to know the internal plugin name, which can be viewed in the following table:

Package Internal name
dev-python/anyio anyio
dev-python/hypothesis
dev-python/pyfakefs
dev-python/pytest-aiohttp aiohttp
dev-python/pytest-asyncio asyncio
dev-python/pytest-cov cov
dev-python/pytest-datadir datadir
dev-python/pytest-describe describe
dev-python/pytest-django django
dev-python/pytest-env env
dev-python/pytest-expect expect
dev-python/pytest-forked forked
dev-python/pytest-freezegun freezegun
dev-python/pytest-html html
dev-python/pytest-httpx httpx
dev-python/pytest-metadata metadata
dev-python/pytest-mock mock
dev-python/pytest-subtests
dev-python/pytest-xdist xdist