2017-01-23 18 views
0

Проблема: Колба приложение строится с Pybuilder необходимо Покрытие исключить run.py во время сборки, чтобы избавиться от предупредит сообщение и воздействие на процент охватаКак обновить покрытие (которое включено в pybuilder) в модуль igrore run.py?

[WARN] Module 'run' was not imported by the covered tests 

и

[WARN] Test coverage below 70% for run: 0% 

в

(env3)$ python3 build.py 
PyBuilder version 0.11.9 
Build started at 2017-01-23 12:48:03 
------------------------------------------------------------ 
[INFO] Building myproject version 0.0.1.00526 
[INFO] Executing build in /Users/zzzz/Documents/Projects/myproject 
[INFO] Going to execute tasks: clean, install_dependencies, analyze, publish 
[INFO] Removing target directory /Users/zzzz/Documents/Projects/myproject/target 
[INFO] Installing all dependencies 
[INFO] Running unit tests 
[INFO] Executing unit tests from Python modules in /Users/zzzz/Documents/Projects/myproject/src/unittest/python 
[INFO] Executed 14 unit tests 
[INFO] All unit tests passed. 
[INFO] Executing flake8 on project sources. 
[INFO] Collecting coverage information 
[WARN] coverage_branch_threshold_warn is 0 and branch coverage will not be checked 
[WARN] coverage_branch_partial_threshold_warn is 0 and partial branch coverage will not be checked 
[INFO] Running unit tests 
[INFO] Executing unit tests from Python modules in /Users/zzzz/Documents/Projects/myproject/src/unittest/python 
[INFO] Executed 14 unit tests 
[INFO] All unit tests passed. 
[WARN] Module 'run' was not imported by the covered tests 
------------------------------------------------------------ 
BUILD FAILED - Build aborted 
------------------------------------------------------------ 
Build finished at 2017-01-23 12:48:16 
Build took 12 seconds (12694 ms) 
[WARN] Test coverage below 70% for run: 0% 
[WARN] Test coverage below 70% for run: 0% 
[WARN] Test coverage below 70% for app.mod_upload: 21% 
[WARN] Test coverage below 70% for app.mod_upload: 21% 
[INFO] Overall coverage is 79% 
[INFO] Overall coverage branch coverage is 66% 
[INFO] Overall coverage partial branch coverage is 77% 
[INFO] Overall coverage is 79% 
[INFO] Overall coverage branch coverage is 66% 
[INFO] Overall coverage partial branch coverage is 77% 
(env3)$ 

Вопрос: Я мог бы использовать answer here, но покрытие, выполняемое pybuild, а не я из командной строки, так что решение -omit не совсем применимо, что создает проблему. Может ли кто-нибудь проконсультироваться?

+0

Это предупреждение от pybuilder ([здесь] (https://github.com/pybuilder/pybuilder/blob/3bb52943e4e78dc316525f6facd2231bc956f5c1/src/main/python/pybuilder/plugins/python/coverage_plugin.py#L165)), так что общий answer.py ответ, вероятно, не поможет. –

ответ

0

Найден ответ! Решение: в build.py (часть pybuilder проекта) добавить:

@init 
def set_properties(project): 
    project.set_property("coverage_exceptions", ['run',]) 

список может быть расширен с другими модулями по мере необходимости.

 Смежные вопросы

  • Нет связанных вопросов^_^