pytest-dev / pytest-dev/pytest

Misleading plugin names in test session details

Open
#5,661 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

topic: reporting type: enhancement
Dominant language
Python
Stars
14.5k
Forks
3.4k
Avg merge
2d 9h
Merged PRs (30d)
35

Description

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:

  • In the plugins section in the test session details display the real plugin name (e.g. pytest-bdd instead of bdd,
  • Allow using plugin name from the plugins section with -p no:<plugin-name> argument.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the test session details output with plugins such as pytest-bdd and pyfakefs, then trace how plugin names are displayed and how the -p no: option resolves them. Done means the summary exposes names that can disable the corresponding plugins, or clearly documents a reliable way to retrieve and use their actual names.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.