MCPcopy Create free account
hub / github.com/dateutil/dateutil / pytest_collection_modifyitems

Function pytest_collection_modifyitems

tests/conftest.py:7–20  ·  view source on GitHub ↗
(items)

Source from the content-addressed store, hash-verified

5# Configure pytest to ignore xfailing tests
6# See: https://stackoverflow.com/a/53198349/467366
7def pytest_collection_modifyitems(items):
8 for item in items:
9 marker_getter = getattr(item, 'get_closest_marker', None)
10
11 # Python 3.3 support
12 if marker_getter is None:
13 marker_getter = item.get_marker
14
15 marker = marker_getter('xfail')
16
17 # Need to query the args because conditional xfail tests still have
18 # the xfail mark even if they are not expected to fail
19 if marker and (not marker.args or marker.args[0]):
20 item.add_marker(pytest.mark.no_cover)
21
22
23def set_tzpath():

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected