pytest-dev / pytest-dev/pytest

[FR] Support for env-dependent `filterwarnings` entries

Open
#7,525 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

For example, if I want to add ignore for the deprecation warning that only happens on Python 3.5 and POSIX, I want some entries to only apply to that. The example pseudosyntax:

filterwarnings =
    error
    ignore::DeprecationWarning; python_version == '3.5' and sys_platform != 'Windows'

(that is completely made up after the env markers but hopefully, you've got the idea)

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 files, tests, or entry points are named. Start by reviewing pytest's existing filterwarnings configuration handling and how environment markers are represented elsewhere; define the supported syntax and its behavior across Python versions and platforms. Done means conditional filterwarnings entries work for the proposed Python and POSIX case, with coverage for the agreed syntax.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.