我有一个传统上使用make文件运行单元测试的项目,如
NOSE_CMD=nosetests --config setup.cfg
test:
$(NOSE_CMD)
test-fast:
$(NOSE_CMD) -A "not slow and not valuations"
test-slow:
$(NOSE_CMD) -A "slow or valuations"像这样的setup.cfg
[nosetests]
all-modules=1
with-doctest=1
verbosity=3
processes=3
process-timeout=600
exe=1现在,我正在尝试从Python脚本中运行所有这些。我第一次尝试从上面模仿“让测试快速”的行为是
argv = ['-A "not slow and not valuations"']
nose.run(argv=argv)不过,这不管用。它正在运行我的所有测试,而不考虑属性。这是因为我需要手动激活属性插件吗?
非常感谢你的帮助。
发布于 2014-02-21 17:34:34
尝试:
argv = ['-A', 'not slow and not valuations']
nose.main(argv=argv)https://stackoverflow.com/questions/21940747
复制相似问题