White scenery @showyou, hatena

If you have any comments, you may also send twitter @shsub or @showyou.

noseが残念な話

1.import nose;nose.main()ができない

これうちの環境(Ubuntu 9.04 x86, python 2.6.4)だけなのかもしれないけど

def testHoge():
    ...

if __name__ == '__main__':
    import nose
    nose.main()

python test.pyとやっても0 testsになる。

2.utf-8対応が貧弱

これunittestからっぽいけど、nose.tools.assertEqualの結果が

AssertionError: u'\u691c\u7d22\u30b5\u30a4\u30c8 ' != u'\u691c\u7d22\u30b5\u30a4
\u30c8'

みたいな感じで出て貧弱。ちなみにnoseのassertだとそもそもエラー時に出力されない。


しかもprint関数使うとエンコードエラーが出る。unittestだと問題ないんですけどね。