File: conftest.py

package info (click to toggle)
chirp 1%3A20251108-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,728 kB
  • sloc: python: 156,369; ansic: 296; sh: 219; xml: 24; makefile: 19
file content (15 lines) | stat: -rw-r--r-- 528 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import os

import pytest


def pytest_collection_modifyitems(config, items):
    xfails = os.path.join(os.path.dirname(__file__), 'xfails.txt')
    with open(xfails) as f:
        lines = [x.strip() for x in f.readlines() if not x.startswith('#')]
    msg = ('Test marked for XFAIL in tests/xfails.txt, but did not fail. '
           'If this test is now fixed, remove it from the file.')
    for item in items:
        if item.nodeid in lines:
            mark = pytest.mark.xfail(reason=msg)
            item.add_marker(mark)