Contenu connexe
Similaire à 【Pycon2012】unittest嫌いがunitestをtesting
Similaire à 【Pycon2012】unittest嫌いがunitestをtesting (20)
【Pycon2012】unittest嫌いがunitestをtesting
- 1. unittest嫌いが
unitestをtesting
発表者 : 会津 剛
Twitter : @Ido
12年10月22日月曜日
- 2. あんた、だれよ
• @Ido(あいづ つよし)
• 株式会社バスキュール号所属
できない担当
• 元々はFlashエンジニア
(たぶん今も)
• 業務でPython使い始めて 約2年
• unittestsあまり書きません
12年10月22日月曜日
- 3. みなさん
CD、CI
してますか?
12年10月22日月曜日
- 4. CI、CDには
unittestを書くのが必須
12年10月22日月曜日
- 7. Python testing
tools taxonomy
http://pycheesecake.org/wiki/
PythonTestingToolsTaxonomy
12年10月22日月曜日
- 12. 以上の
詳しい説明はしません
12年10月22日月曜日
- 15. サンプル実行環境の
ダウンロード
https://bitbucket.org/aizu/pycon2012_sample/
downloads
12年10月22日月曜日
- 16. • testoob
• python-subunit
• testtools
• testosterone
12年10月22日月曜日
- 17. testoob
v1.15(2009-10-08)
http://code.google.com/p/testoob/
12年10月22日月曜日
- 18. testoobの概要
• unittestの機能拡張
• 正規表現やグロブを使ってテストのフィルタリ
ングしXMLやHTMLで結果を出力できる
• テストが失敗したときにpdb(デバッガ)を起動
できる
• より詳細なレポートの出力ができる
• etc...
12年10月22日月曜日
- 19. • 結果をカラー出力にする
bin/testoob --color-mode=auto tests/suite.py
• テストメソッド名を正規表現で絞り込む
testoob tests/suite.py --regex='test[A-D]'
• 結果をHTML出力
bin/testoob --html=test.html tests/suite.py
• エラー時にPDBを立ち上げる
bin/testoob --debug tests/suite.py
• エラー時に冗長な情報を表示
bin/testoob --vassert tests/suite.py
12年10月22日月曜日
- 20. python-subunit
v0.0.8(2012-05-07)
http://pypi.python.org/pypi/python-subunit/
12年10月22日月曜日
- 21. python-subunitの概要
• unitestを他の言語と容易に連携させる
ための仲介を行い、統合したテストを
行うことができる
12年10月22日月曜日
- 22. • コマンドラインテスト
bin/python -m subunit.run tests.suite
• シェルコマンドラインテスト
python -m subunit.run tests.sub_suite
12年10月22日月曜日
- 23. testtools
v0.9.6(2012-08-10)
http://testtools.readthedocs.org/en/latest/
12年10月22日月曜日
- 24. testtoolsの概要
• TwistedやBazzrのようなプロジェクトか
ら派生した,便利なunittestの機能拡張
• 比較メソッドが多岐にわたる
• 非同期の遅延テストができる
• テスト時にモンキーパッチが容易に行え
る
12年10月22日月曜日
- 25. testosterone
改め
assertEquals
v0.4.2(2012-03-29)
https://github.com/whit537/assertEquals
12年10月22日月曜日
- 26. assertEquals
• 漢のテストランナー
• コマンドラインとcursesのインター
フェイスを提供し、より簡単にテスト
の失敗を見つけることができる
12年10月22日月曜日
- 29. unittestを
使いましょう
そこまで詳細なテストしないし
12年10月22日月曜日
- 30. ご清聴
ありがとうございました
12年10月22日月曜日