2015-07-16から1日間の記事一覧

pythonのTestでテストケースの動的追加

チェック処理は同じでデータが違うときなどにいちいちtest_aaa、test_bbbと定義するのがめんどくさい時に以下のようにすると楽になる話。 from unittest import TestCase import requests class Test(TestCase): pass for user_id in xrange(1, 10): def wra…