python nosetest配置文件解析错误

时间:2013-08-05 15:43:15

标签: python command-line configuration configuration-files nosetests

我的配置文件看起来像这样

# function class,dir, file match this regular expression are considered tests
[NOSE_TESTMATCH]
#by default this is-  (?:^|[\b_\./-])[Tt]est

# The file names after this block are ignored while testing
[NOSE_IGNORE_FILES]
test_case_1.py
# the regex that match the specified regex(if any) are excluded from tests
[NOSE_EXCLUDE]
#eg: test_s*

# the regex that match the specified regex(if any) are included from tests
[NOSE_INCLUDE]

#eg: test_s*

当我使用-c选项运行nosetests时,我得到了这个输出

[kiran@my_redhat test]$ nosetests -w cases/ -s -c examples/nose_test.config
Usage: nosetests [options]

**nosetests: error: Error reading config file 'examples/nose_test.config': File contains parsing errors: examples/nose_test.config
        [line  7]: 'test_case_1.py\n'**

2 个答案:

答案 0 :(得分:0)

解决方案非常简单。

基本上文档不好。

它只是一个nosetests块和后续行中的其他选项。 例如

  

[nosetests]

     

忽略-文件= abc.py

由于

答案 1 :(得分:0)

>[nosetests]
>ignore-files=<path of files>
>exclude=<path of files>
>include=<path of files>

会有所帮助