MCPcopy Create free account
hub / github.com/python/mypy / match_module_order

Function match_module_order

mypy/test/helpers.py:137–149  ·  view source on GitHub ↗
(actual: list[str], expected_order: list[str])

Source from the content-addressed store, hash-verified

135
136
137def match_module_order(actual: list[str], expected_order: list[str]) -> list[str]:
138 actual_by_mod = defaultdict(list)
139 actual_order = module_order(actual)
140 if set(actual_order) != set(expected_order):
141 # Different files, give up and show actual errors.
142 return actual
143 for a in actual:
144 mod, _ = a.split(":", maxsplit=1)
145 actual_by_mod[mod].append(a)
146 result = []
147 for mod in expected_order:
148 result.extend(actual_by_mod[mod])
149 return result
150
151
152def assert_string_arrays_equal(

Callers 1

Calls 5

module_orderFunction · 0.85
setClass · 0.85
splitMethod · 0.80
appendMethod · 0.80
extendMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…