2015-09-16 37 views
1

我有以下行的文件有:錯誤插件在CFG文件中使用nosetest

suite = LazySuite(all_tests) 
run(suite=suite, argv=['','-c', 'nose.cfg']) 

而且我有這個鼻子配置文件:

[nosetests] 
stop=1 
with-xunit=1 
xunit-file=test.xml 

當我運行測試時,以下消息顯示:

Usage: TestSuite1.py [options] 

TestSuite1.py: error: Error reading config file 'nose.cfg': no such option 'with-xunit' 

Process finished with exit code 2 

我不知道發生了什麼,因爲如果我在cmd中直接執行了xunit插件作爲ar這個腳本是毫無問題地執行的。

有什麼建議嗎?

回答

1

我發現了這個問題。

我定義下面幾行的配置:

c = Config() 
cf = c.configure(argv=['','-c', 'nose.cfg']) 

:)