pytest-dev / pytest-dev/pytest

Provide better message when pytest receives invalid filter with `-W`

Open
#8,096 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Your -ArgumentList $myparams -Wait -PassThru causes -Wait to be passed to pytest - that in turn passes it to Python's warnings module as an ait warning filter, which isn't valid.

I suppose pytest could show a better error message in this case though.

Originally posted by @The-Compiler in https://github.com/pytest-dev/pytest/issues/8095#issuecomment-737862151

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

No file or test is named in the issue. Start by reproducing pytest with an invalid warning filter passed through -W, then trace the command-line warning-filter error path; done means pytest reports a clearer error for this case.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.