2016-01-14 43 views
1

這是nosetests只挑選無可執行文件的正常行爲.py? 是否有任何替代方案來設置nosetests以獲取測試目錄中的所有.py文件?這是鼻子測試的正常行爲,只挑選無可執行文件.py?

項目

樹結構:

├── __init__.py 
├── lib 
│   ├── add_quiz.py 
│   ├── __init__.py 
│   └── take_quiz.py 
├── README 
├── setup.py 
└── tests 
    ├── add_quiz_test.py 
    ├── __init__.py 
    ├── testCases 
    └── testData 

設置權限爲不可執行,而nosetests皮卡的測試運行

[[email protected] quiz]$ chmod oug-x tests/add_quiz_test.py 
[[email protected] quiz]$ nosetests -v -v -w . 
nose.config: INFO: Set working dir to /home/gliang/work/prima/quiz 
nose.config: INFO: Working directory /home/gliang/work/prima/quiz is a package; adding to sys.path 
nose.selector: INFO: /home/gliang/work/prima/quiz/lib/add_quiz.py is executable; skipped 
nose.selector: INFO: /home/gliang/work/prima/quiz/lib/take_quiz.py is executable; skipped 
test1 (quiz.tests.add_quiz_test.add_quizTest) ... ok 
test2 (quiz.tests.add_quiz_test.add_quizTest) ... ok 

---------------------------------------------------------------------- 
Ran 2 tests in 0.001s 

OK 

不是我設置權限爲可執行

[[email protected] quiz]$ chmod oug+x tests/add_quiz_test.py 
[[email protected] quiz]$ nosetests -v -v -w . 
nose.config: INFO: Set working dir to /home/gliang/work/prima/quiz 
nose.config: INFO: Working directory /home/gliang/work/prima/quiz is a package; adding to sys.path 
nose.selector: INFO: /home/gliang/work/prima/quiz/lib/add_quiz.py is executable; skipped 
nose.selector: INFO: /home/gliang/work/prima/quiz/lib/take_quiz.py is executable; skipped 
nose.selector: INFO: /home/gliang/work/prima/quiz/tests/add_quiz_test.py is executable; skipped 

---------------------------------------------------------------------- 
Ran 0 tests in 0.000s 

OK 

回答

相關問題