AlexeySanko / pybuilder_pytest

Pytest plugin for PyBuilder: https://github.com/pybuilder/pybuilder
6 stars 3 forks source link

pybuilder_pytest should not run without a task #10

Closed rhytnen closed 7 years ago

rhytnen commented 7 years ago

pytest runs by default but to be consistent, it should be required in the task list

AlexeySanko commented 7 years ago

pytest plugin is alternative for basic unittest plugin use_plugin("python.unittest") and uses the same task - run_unit_tests Is it called without run_unit_tests task?

rhytnen commented 7 years ago

correct. just including the plugin causes it to run regardless of whether it's in the tasklist

AlexeySanko commented 7 years ago

Which task do You call? publish task, for example, call run_unit_tests as dependency.

AlexeySanko commented 7 years ago

For example, if I call pyb clean publish --debug Into output: [DEBUG] Execution plan is clean, prepare, compile_sources, run_unit_tests, package, run_integration_tests, verify, publish

AlexeySanko commented 7 years ago

If it's reason of pytest calling You can skip any task with -x argument usage:

-x <task>, --exclude=<task>
 +                          Exclude optional task dependencies

Like:

subprocess.check_call([build_script, "clean", "install_dependencies", "publish", "-x", "verify", "-x", "analyze",
 +                           "-x", "run_unit_tests", "-x", "run_integration_tests", "-x", "coverage"])