define_04_tests¶
Testing Automation for Python Projects.
- class pywf_open_source.define_04_tests.PyWfTests[source]¶
Namespace class for testing related automation.
- run_unit_test(real_run: bool = True, verbose: bool = True)[source]¶
A wrapper of
pytestcommand to run unit test.Run:
pytest tests -s --rootdir=/path/to/project/root
- run_cov_test(real_run: bool = True, verbose: bool = True)[source]¶
A wrapper of
pytestcommand to run code coverage test.Run:
pytest -s --tb=native --rootdir=/path/to/project/root --cov=package_name --cov-report term-missing --cov-report html:/path/to/htmlcov tests
- view_cov(real_run: bool = True, verbose: bool = True)[source]¶
View coverage test output html file locally in web browser.
It is usually at the
${dir_project_root}/htmlcov/index.html# For MacOS / Linux open htmlcov/index.html # For Windows start htmlcov/index.html