pytest-dev / pytest-dev/pytest

unrecognized arguments when using "-p" option

Open
#6,963 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Windows 10
piplist.txt

using Wing IDE to run tests causes error

ERROR: usage: --html=report.html [options] [file_or_dir] [file_or_dir] [...]
--html=report.html: error: unrecognized arguments: --verbose
inifile: None
rootdir:

<ExitCode.USAGE_ERROR: 4>

i've found that it uses following pre-arguments
our_args=['-s', '-p', 'no:terminal']
then adds args user pass, so the resulting args may look like
finargs = ['-s', '-p', 'no:terminal', '--html=report.html', '--alluredir=allure-result', '--verbose', '--durations=1', '--numprocesses=1', '<suit_path>']
and execution code is
pytest.main(args=finargs)
which end with error
also i've found that removing '-p', 'no:terminal' solves the problem
and unfortunately there is no alternative for "-p" to use like --p=no:terminal

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

Start by reproducing the Windows 10 case through pytest.main(args=finargs), using the listed arguments and the -p no:terminal pair. Inspect pytest's argument parsing and plugin-loading entry points to identify why --verbose is rejected in this combination; done means the reported invocation no longer produces the usage error while retaining the intended plugin behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.