MCPcopy Create free account
hub / github.com/apache/tvm / pytest_collection_modifyitems

Function pytest_collection_modifyitems

conftest.py:64–77  ·  view source on GitHub ↗
(config, items)

Source from the content-addressed store, hash-verified

62
63
64def pytest_collection_modifyitems(config, items):
65 if not all(k in os.environ for k in ["CI", "TVM_NUM_SHARDS", "TVM_SHARD_INDEX"]):
66 # Only apportion tests if in CI and in a job that is set up for it
67 return
68
69 num_shards = int(os.environ["TVM_NUM_SHARDS"])
70 shard_index = int(os.environ["TVM_SHARD_INDEX"])
71
72 print(f"Marking tests for shard {shard_index} of {num_shards}")
73 items_copy = list(items)
74 for item in items_copy:
75 item_shard_index = find_shard_index(item.nodeid, num_shards=num_shards)
76 if item_shard_index != shard_index:
77 items.remove(item)
78
79
80def pytest_sessionstart():

Callers

nothing calls this directly

Calls 4

printFunction · 0.85
find_shard_indexFunction · 0.85
allFunction · 0.50
removeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…