{"type":"rich","description":"open\u306e\u5148\u306eread\u3067\u4f8b\u5916(exception)\u8d77\u3053\u3057\u305f\u3044\u3068\u304d\u306e\u30d1\u30c3\u30c1\u306e\u3042\u3066\u304b\u305f \u666e\u901a\u306bpatch\u3042\u3066\u3066side_effect=Exception\u3057\u305f\u3089\u30a8\u30e9\u30fc\u306b\u306a\u3063\u305f\u304b\u3089\u3001\u4e0b\u8a18\u3067\u56de\u907f\u3057\u305f\u3002 (\u30a8\u30e9\u30fc\u6587\u30b3\u30d4\u30da\u5fd8\u308c\u305f\u3051\u3069\u30e2\u30b8\u30e5\u30fc\u30eb\u30a8\u30e9\u30fc\u3060\u3063\u305f\u304b\u306a\uff1f) open\u3068read\u4e21\u65b9\u306bpatch\u3042\u3066\u308b\u65b9\u6cd5\u3068\u3084\u308a\u304b\u305f @patch('__builtin__.open.return_value.__enter__.return_value.read', side_effect=Exception) @patch('__builtin__.open') def test_foo(self, open, read\u2026","categories":["\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0(python)"],"blog_url":"https://tako-eng.hatenablog.com/","url":"https://tako-eng.hatenablog.com/entry/2019/09/20/073700","author_url":"https://blog.hatena.ne.jp/tako_eng/","version":"1.0","provider_url":"https://hatena.blog","height":"190","width":"100%","published":"2019-09-20 07:37:00","provider_name":"Hatena Blog","title":"open\u306e\u5148\u306eread\u3067\u4f8b\u5916\u8d77\u3053\u3057\u305f\u3044\u3068\u304d(python2.x\u7cfb)","blog_title":"blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftako-eng.hatenablog.com%2Fentry%2F2019%2F09%2F20%2F073700\" title=\"open\u306e\u5148\u306eread\u3067\u4f8b\u5916\u8d77\u3053\u3057\u305f\u3044\u3068\u304d(python2.x\u7cfb) - blog\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","image_url":null,"author_name":"tako_eng"}