pytest-dev / pytest

The pytest framework makes it easy to write small tests, yet scales to support complex functional testing
https://pytest.org
MIT License
12.1k stars 2.68k forks source link

Misleading plugin names in test session details #5661

Open aklajnert opened 5 years ago

aklajnert commented 5 years ago

Here is sample test session details from my environment:

============================= test session starts ==============================
platform linux -- Python 3.7.0, pytest-5.0.1, py-1.8.0, pluggy-0.12.0
cachedir: .pytest_cache
rootdir: /..., inifile: tox.ini
plugins: cov-2.6.1, pycharm-0.5.0, rerunfailures-7.0, sentry-0.1.0, bdd-3.1.0, pyfakefs-3.5.8

The last line displays a list of loaded plugins, which is very useful. According to the documentation, in order to disable a plugin, you need to use the -p argument, e.g. pytest -p no:<plugin-name>.

The problem is that not all plugin names are accurately reflected in the plugins section of the summary, to be useful with -p argument. For example, to disable cov you can use -p no:cov, but to disable bdd you need to use -p no:pytest-bdd. I have no idea how to disable the pyfakefs plugin. Neither -p no:pytest-pyfakefs nor -p no:pyfakefs works. I see no other option for retrieving that information other than debugging pytest itself.

I see two possible solutions here:

blueyed commented 5 years ago

I think both of your suggested solutions for this are fine.

RonnyPfannschmidt commented 5 years ago

i propose that we accept distribution names to disable all plugins of that distribution

we still need a way to distinguish between actual module names, entry-point names and python object names

i would like to propose that we use any name without a collon as whatever works, for due diligence warn if its ambiguous, and additionally have no-mod/ep/dist: for picking exactly whats wanted

i believe this one needs to bubble into pluggy