<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ohke</author_name>
  <author_url>https://blog.hatena.ne.jp/ohke/</author_url>
  <blog_title>け日記</blog_title>
  <blog_url>https://ohke.hateblo.jp/</blog_url>
  <categories>
    <anon>Python</anon>
    <anon>テスト</anon>
  </categories>
  <description>Python (3.3以降) でユニットテストのモックを楽に作れるunittest.mockが標準ライブラリとして提供されてます。今回はその紹介を行います。 外部モジュールに依存した実装をテストする難しさ ユニットテストの実現において、DBやWeb APIなどのアプリケーション外のモジュールに依存している実装をどう扱うかは難しい問題です。 テストしやすいように (= 外部モジュールの影響範囲が小さくなるように) アプリケーションを適切に分割していくのも1つの手ですが、実務上、外部モジュールを含めたテストを完全には避けることは難しいです。 外部モジュールを含めたテストを行う場合、それらの振る舞い…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fohke.hateblo.jp%2Fentry%2F2019%2F10%2F26%2F235500&quot; title=&quot;Python: unittest.mockでモックを作ってテストする - け日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn.user.blog.st-hatena.com/default_entry_og_image/99455833/1533459624629378</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2019-10-26 23:55:00</published>
  <title>Python: unittest.mockでモックを作ってテストする</title>
  <type>rich</type>
  <url>https://ohke.hateblo.jp/entry/2019/10/26/235500</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
