MCPcopy
hub / github.com/pallets/werkzeug / test_proxy_iop

Function test_proxy_iop

tests/test_local.py:356–382  ·  view source on GitHub ↗
(op)

Source from the content-addressed store, hash-verified

354 ],
355)
356def test_proxy_iop(op):
357 class Example:
358 value = 1
359
360 def fake_op(self, other):
361 self.value = other
362 return self
363
364 __iadd__ = fake_op
365 __isub__ = fake_op
366 __imul__ = fake_op
367 __imatmul__ = fake_op
368 __itruediv__ = fake_op
369 __ifloordiv__ = fake_op
370 __imod__ = fake_op
371 __ipow__ = fake_op
372 __ilshift__ = fake_op
373 __irshift__ = fake_op
374 __iand__ = fake_op
375 __ior__ = fake_op
376 __ixor__ = fake_op
377
378 ns, p = _make_proxy(Example())
379 p_out = op(p, 2)
380 assert type(p_out) is local.LocalProxy
381 assert p.value == 2
382 assert ns.value.value == 2
383
384
385def test_proxy_matmul():

Callers

nothing calls this directly

Calls 2

_make_proxyFunction · 0.85
ExampleClass · 0.85

Tested by

no test coverage detected