MCPcopy Create free account
hub / github.com/StackStorm/st2 / get_group_id

Function get_group_id

conftest.py:47–52  ·  view source on GitHub ↗
(node: nodes.Node)

Source from the content-addressed store, hash-verified

45 raise ValueError("Invalid test-group argument")
46
47 def get_group_id(node: nodes.Node) -> int:
48 # use the file path instead of node id, so all tests in a file run together.
49 path_bytes = str(node.path).encode()
50 digest_bytes = hashlib.sha256(path_bytes).digest()
51 digest = int.from_bytes(digest_bytes, "little")
52 return digest % group_count
53
54 return [item for item in items if get_group_id(item) == group_id]
55

Callers 1

get_groupFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected