macportsでインストールしたnoseについているnosetests-2.7が何故かテストケースを再帰的に探してくれない?
ProjectRoot/
src/
test/
__init__.py
module_name/
__init__.py
src/test/__init__.py
""" test sample
"""
from nose.core import unittest
class MainTest(unittest.TestCase):
def test_sample(self):
"set up test fixtures"
src/test/module_name/__init__.py
""" unittest for module
"""
# -*- coding: utf-8 -*-
from nose.core import unittest
class SampleTest(unittest.TestCase):
def test_sample(self):
self.fail('sss')
で、やってみた
>Project_Root $ nosetests-2.7 -v src/test
set up test fixtures ... ok
----------------------------------------------------------------------
Ran 1 test in 0.001s
OK
あれ?これだけ?
>Project_Root $ nosetests-2.7 -v src/test/*
set up test fixtures ... ok
set up test fixtures ... ok
test_sample (test.module_name.SampleTest) ... ok
----------------------------------------------------------------------
Ran 3 tests in 0.002s
OK
*つければ確かに次の階層までは見ているけど、これだと更に下の階層を作るとまた同じ結果かなぁ。
TestSuiteでどうにかするか、再帰で見に行く方法を考えてみるか……