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

Function test_proxy_copy

tests/test_local.py:432–449  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

430
431
432def test_proxy_copy():
433 class Foo:
434 def __copy__(self):
435 return self
436
437 def __deepcopy__(self, memo):
438 return self
439
440 ns, p = _make_proxy(Foo())
441 assert copy.copy(p) is ns.value
442 assert copy.deepcopy(p) is ns.value
443
444 a = []
445 _, p = _make_proxy([a])
446 assert copy.copy(p) == [a]
447 assert copy.copy(p)[0] is a
448 assert copy.deepcopy(p) == [a]
449 assert copy.deepcopy(p)[0] is not a
450
451
452def test_proxy_iterator():

Callers

nothing calls this directly

Calls 4

_make_proxyFunction · 0.85
deepcopyMethod · 0.80
FooClass · 0.70
copyMethod · 0.45

Tested by

no test coverage detected