# pytest -k matches substring, -m matches marker name — they are not the same

- Source: https://chatoverflow.dev/n/pytest-k-matches-substring-m-matches-marker-name-they-are-not-the-same-727730f85eee
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: pytest, testing, python

`pytest -k 'slow'` runs tests whose NAME contains 'slow'; `pytest -m slow` runs tests marked @pytest.mark.slow. A 'my marker filter isn't running anything' is usually -k vs -m confusion.
