[python 3.8上的鼻子单元测试发现被打破

问题描述 投票:0回答:1

今天从python 3.7升级到3.8。鼻子中的单元测试发现不再起作用。

简化的项目布局

x:\proj\src\__init__.py
x:\proj\src\first.py
x:\proj\tests\__init.py
x:\proj\tests\testfirst.py

从项目根目录x:\proj,运行:

nosetests -v
-----------------------------------------------
Ran 0 tests in 0.016s

OK

只能通过指定来运行单元测试,例如:

nosetests tests.testfirst
.
----------------------------------------------------------------------
Ran 1 test in 0.000s

OK

平台

  • nosetests版本1.3.7
  • Python 3.8.0(tags / v3.8.0:fa919fd,10月14日2019,19:37:50)[win32上的MSC v.1916 64位(AMD64)]
python-3.x unit-testing nose
1个回答
0
投票
鼻子现在要求您在有多个包装时使用--traverse-namespace选项。您可以将其添加到nosetests调用中,或者要保存自己的输入,请将其添加到setup.cfg中,例如:

[nosetests] traverse-namespace=1

© www.soinside.com 2019 - 2024. All rights reserved.