프로젝트 디렉토리에 __init__.py
파일을 삭제를 할 수 있는지 어떤 아이디어. Project가 Python 패키지가 될 것으로 보이지 않으므로 필요하지 않습니다. 그런 다음,이 디렉토리 구조를 갖는
Project
└── my_mod
├── __init__.py
├── some_module.py
├── test
│ ├── __init__.py
│ ├── test_my_mod_again.py
│ └── test_my_mod_yet_again.py
└── test_my_mod.py
가 my_mod/디렉토리 내에 시험/디렉토리 안에 모두, 이제 테스트를 실행 프로젝트 내부 nosetests
을 실행합니다.
import unittest
from my_mod import some_module
class MyTestCase(unittest.TestCase):
def test_the_number(self):
assert some_module.double(10) == 20
: 물론
은 테스트 파일의 내용은 다음과 같은 nosetests
테스트로 인식 할 수있는 무언가를 포함해야