MCPcopy Index your code
hub / github.com/python/cpython / test_with_statement_as

Method test_with_statement_as

Lib/test/test_unittest/testmock/testwith.py:32–37  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

30
31
32 def test_with_statement_as(self):
33 with patch('%s.something' % __name__) as mock_something:
34 self.assertEqual(something, mock_something, "unpatched")
35 self.assertTrue(is_instance(mock_something, MagicMock),
36 "patching wrong type")
37 self.assertEqual(something, sentinel.Something)
38
39
40 def test_patch_object_with_statement(self):

Callers

nothing calls this directly

Calls 4

patchFunction · 0.90
is_instanceFunction · 0.90
assertTrueMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected