MCPcopy Index your code
hub / github.com/python/mypy / assert_transitive_closure

Method assert_transitive_closure

mypy/test/testsolve.py:267–281  ·  view source on GitHub ↗
(
        self,
        vars: list[TypeVarId],
        constraints: list[Constraint],
        graph: Graph,
        lowers: Bounds,
        uppers: Bounds,
    )

Source from the content-addressed store, hash-verified

265 assert_equal(actual_free, free_vars)
266
267 def assert_transitive_closure(
268 self,
269 vars: list[TypeVarId],
270 constraints: list[Constraint],
271 graph: Graph,
272 lowers: Bounds,
273 uppers: Bounds,
274 ) -> None:
275 actual_graph, actual_lowers, actual_uppers = transitive_closure(vars, constraints)
276 # Add trivial elements.
277 for v in vars:
278 graph.add((v, v))
279 assert_equal(actual_graph, graph)
280 assert_equal(dict(actual_lowers), lowers)
281 assert_equal(dict(actual_uppers), uppers)
282
283 def supc(self, type_var: TypeVarType, bound: Type) -> Constraint:
284 return Constraint(type_var, SUPERTYPE_OF, bound)

Calls 4

transitive_closureFunction · 0.90
assert_equalFunction · 0.90
dictClass · 0.85
addMethod · 0.45

Tested by

no test coverage detected