Skip to main content

Filter pytest marks by name using match kw

Project description

Mark Filter

Most pytest marks accept additional keywords arguments. This plugin will check for the match and not_match keywords. Any test that has the string in its name will be filtered accordingly. You can use both at the same time too.

Match

import pytest

pytestmark = [
    pytest.mark.skipif(match="skip")
]

def test_normal():
    pass

def test_skip():
    pass

def test_other():
    pass

Any test that has "skip" in the name will get the mark. In this case, test_skip.

Not Match

import pytest

pytestmark = [
    pytest.mark.skipif(not_match="skip")
]

def test_normal():
    pass

def test_skip():
    pass

def test_other():
    pass

Any test that doesn't have "skip" in the name will get the mark. In this case, test_normal and test_other.

Installing

pip install pytest-mark-filter

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest_mark_filter-0.1.2.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_mark_filter-0.1.2-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file pytest_mark_filter-0.1.2.tar.gz.

File metadata

  • Download URL: pytest_mark_filter-0.1.2.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.17

File hashes

Hashes for pytest_mark_filter-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8454964fefb4e28a13734f6f8de2ff9b5270fb58013cd68c15152c1e72721514
MD5 885d6ba5f99acec0bc9250ecbd9d2403
BLAKE2b-256 5c3a0fd66c1c05781d11de69b9ecab7274c9c5b9606cc35300cbea109ba6cc13

See more details on using hashes here.

File details

Details for the file pytest_mark_filter-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_mark_filter-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 63fdd24f86609da46b140789e9f41cc12b9f76816696f173f319eed9abd93450
MD5 62c5980455418866abbb060f7044fad5
BLAKE2b-256 5eec24273b45e0251393fae312c09889552ff964ee56ec834876cb9ee59e285c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page