基本上在项目中我使用以下模式:
package:
__init__.py
_mod1.py
_mod2.py
这些模块被认为是实现细节,我不希望用户导入它们。我使用 doctests 来测试那些内部模块。在默认配置中,nosetests 不会在这些模块中找到 doctests。
我尝试使用match
选项修复它(并且匹配 doctest 模块),但我从 python stdlib 获得了虚拟匹配。
系统详情:
- 蟒蛇3.3
- python是从pythonz编译的
- 我使用 virtualenv 和 virtualenvwrapper
- 鼻子测试安装在 virtualenv 中
- 我用鼻子 1.3.0
这是我的鼻子配置文件:
[nosetests]
match=[^.][Tt]est
with-doctest=1
processes=50
process-timeout=25
verbosity=3
attr=!singleprocess
ignore-files=.*pythonz.*
虚假匹配的示例:
======================================================================
ERROR: Skip this test.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jb/.pythonz/pythons/CPython-3.3.2/lib/python3.3/unittest/case.py", line 384, in _executeTestPart
function()
TypeError: skipTest() missing 1 required positional argument: 'reason'
======================================================================
ERROR: Skip this test.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jb/.pythonz/pythons/CPython-3.3.2/lib/python3.3/unittest/case.py", line 384, in _executeTestPart
function()
TypeError: skipTest() missing 1 required positional argument: 'reason'
======================================================================
ERROR: Decorator to mark a function or method as a test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jb/.virtualenvs/silf-backend-commons/lib/python3.3/site-packages/nose/case.py", line 198, in runTest
self.test(*self.arg)
File "/home/jb/.virtualenvs/silf-backend-commons/lib/python3.3/site-packages/nose/util.py", line 613, in newfunc
return func(*arg, **kw)
TypeError: istest() missing 1 required positional argument: 'func'
======================================================================
ERROR: Decorator to mark a function or method as *not* a test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jb/.virtualenvs/silf-backend-commons/lib/python3.3/site-packages/nose/case.py", line 198, in runTest
self.test(*self.arg)
File "/home/jb/.virtualenvs/silf-backend-commons/lib/python3.3/site-packages/nose/util.py", line 613, in newfunc
return func(*arg, **kw)
TypeError: nottest() missing 1 required positional argument: 'func'
======================================================================
ERROR: Skip this test.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jb/.pythonz/pythons/CPython-3.3.2/lib/python3.3/unittest/case.py", line 384, in _executeTestPart
function()
TypeError: skipTest() missing 1 required positional argument: 'reason'
======================================================================
ERROR: Decorator to mark a function or method as a test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jb/.virtualenvs/silf-backend-commons/lib/python3.3/site-packages/nose/case.py", line 198, in runTest
self.test(*self.arg)
File "/home/jb/.virtualenvs/silf-backend-commons/lib/python3.3/site-packages/nose/util.py", line 613, in newfunc
return func(*arg, **kw)
TypeError: istest() missing 1 required positional argument: 'func'
======================================================================
ERROR: Skip this test.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jb/.pythonz/pythons/CPython-3.3.2/lib/python3.3/unittest/case.py", line 384, in _executeTestPart
function()
TypeError: skipTest() missing 1 required positional argument: 'reason'
======================================================================
ERROR: Decorator to mark a function or method as a test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jb/.virtualenvs/silf-backend-commons/lib/python3.3/site-packages/nose/case.py", line 198, in runTest
self.test(*self.arg)
File "/home/jb/.virtualenvs/silf-backend-commons/lib/python3.3/site-packages/nose/util.py", line 613, in newfunc
return func(*arg, **kw)
TypeError: istest() missing 1 required positional argument: 'func'
======================================================================
ERROR: Skip this test.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jb/.pythonz/pythons/CPython-3.3.2/lib/python3.3/unittest/case.py", line 384, in _executeTestPart
function()
TypeError: skipTest() missing 1 required positional argument: 'reason'
======================================================================
ERROR: Skip this test.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jb/.pythonz/pythons/CPython-3.3.2/lib/python3.3/unittest/case.py", line 384, in _executeTestPart
function()
TypeError: skipTest() missing 1 required positional argument: 'reason'
======================================================================
ERROR: Skip this test.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jb/.pythonz/pythons/CPython-3.3.2/lib/python3.3/unittest/case.py", line 384, in _executeTestPart
function()
TypeError: skipTest() missing 1 required positional argument: 'reason'
======================================================================
ERROR: Skip this test.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jb/.pythonz/pythons/CPython-3.3.2/lib/python3.3/unittest/case.py", line 384, in _executeTestPart
function()
TypeError: skipTest() missing 1 required positional argument: 'reason'
======================================================================
ERROR: Skip this test.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jb/.pythonz/pythons/CPython-3.3.2/lib/python3.3/unittest/case.py", line 384, in _executeTestPart
function()
TypeError: skipTest() missing 1 required positional argument: 'reason'
======================================================================
ERROR: Decorator to mark a function or method as a test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jb/.virtualenvs/silf-backend-commons/lib/python3.3/site-packages/nose/case.py", line 198, in runTest
self.test(*self.arg)
File "/home/jb/.virtualenvs/silf-backend-commons/lib/python3.3/site-packages/nose/util.py", line 613, in newfunc
return func(*arg, **kw)
TypeError: istest() missing 1 required positional argument: 'func'
======================================================================
ERROR: Skip this test.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jb/.pythonz/pythons/CPython-3.3.2/lib/python3.3/unittest/case.py", line 384, in _executeTestPart
function()
TypeError: skipTest() missing 1 required positional argument: 'reason'
======================================================================
ERROR: Skip this test.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jb/.pythonz/pythons/CPython-3.3.2/lib/python3.3/unittest/case.py", line 384, in _executeTestPart
function()
TypeError: skipTest() missing 1 required positional argument: 'reason'
======================================================================
ERROR: Skip this test.
----------------------------------------------------------------------
nose.proxy.TypeError: skipTest() missing 1 required positional argument: 'reason'
-------------------- >> begin captured logging << --------------------
root: DEBUG: Firing event <EventObject power_up, (*('default',), **{})>
root: DEBUG: Firing event <EventObject tick, (*(), **{})>
--------------------- >> end captured logging << ---------------------
======================================================================
ERROR: Skip this test.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jb/.pythonz/pythons/CPython-3.3.2/lib/python3.3/unittest/case.py", line 384, in _executeTestPart
function()
TypeError: skipTest() missing 1 required positional argument: 'reason'
======================================================================
ERROR: Skip this test.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jb/.pythonz/pythons/CPython-3.3.2/lib/python3.3/unittest/case.py", line 384, in _executeTestPart
function()
TypeError: skipTest() missing 1 required positional argument: 'reason'
======================================================================
ERROR: Skip this test.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jb/.pythonz/pythons/CPython-3.3.2/lib/python3.3/unittest/case.py", line 384, in _executeTestPart
function()
TypeError: skipTest() missing 1 required positional argument: 'reason'
======================================================================
ERROR: Skip this test.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jb/.pythonz/pythons/CPython-3.3.2/lib/python3.3/unittest/case.py", line 384, in _executeTestPart
function()
TypeError: skipTest() missing 1 required positional argument: 'reason'
======================================================================
ERROR: Skip this test.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jb/.pythonz/pythons/CPython-3.3.2/lib/python3.3/unittest/case.py", line 384, in _executeTestPart
function()
TypeError: skipTest() missing 1 required positional argument: 'reason'
======================================================================
ERROR: Skip this test.
----------------------------------------------------------------------
nose.proxy.TypeError: skipTest() missing 1 required positional argument: 'reason'
-------------------- >> begin captured logging << --------------------
Test: INFO: Initializing experiment
Test: INFO: Initialized client
Test: INFO: Initialized manager
Test: INFO: Started main thread
--------------------- >> end captured logging << ---------------------
======================================================================
ERROR: Skip this test.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jb/.pythonz/pythons/CPython-3.3.2/lib/python3.3/unittest/case.py", line 384, in _executeTestPart
function()
TypeError: skipTest() missing 1 required positional argument: 'reason'
======================================================================
ERROR: Skip this test.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jb/.pythonz/pythons/CPython-3.3.2/lib/python3.3/unittest/case.py", line 384, in _executeTestPart
function()
TypeError: skipTest() missing 1 required positional argument: 'reason'
======================================================================
ERROR: Skip this test.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jb/.pythonz/pythons/CPython-3.3.2/lib/python3.3/unittest/case.py", line 384, in _executeTestPart
function()
TypeError: skipTest() missing 1 required positional argument: 'reason'
======================================================================
ERROR: Skip this test.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jb/.pythonz/pythons/CPython-3.3.2/lib/python3.3/unittest/case.py", line 384, in _executeTestPart
function()
TypeError: skipTest() missing 1 required positional argument: 'reason'
----------------------------------------------------------------------