回答編集履歴

1

環境追記

2017/11/03 04:24

投稿

copepoda
copepoda

スコア324

test CHANGED
@@ -1,3 +1,7 @@
1
+ ** この回答は、Python 3.3+ が対象です。2.7 では動きません。**
2
+
3
+
4
+
1
5
  `PlaySound` 関数が意図した引数で呼び出されたかどうかを確認する[ユニットテスト(unittest)](https://docs.python.jp/3/library/unittest.html)を定義したいのであれば、テストコードで`views`モジュールの`winsound.PlaySound`を[モック(unittest.mock)](https://docs.python.jp/3/library/unittest.mock.html)に置換することでできます。
2
6
 
3
7