define_04_tests

Testing Automation for Python Projects.

class pywf_internal_proprietary.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 pytest command 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 pytest command 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
run_int_test(real_run: bool = True, verbose: bool = True)[source]

A wrapper of pytest command to run integration test.

Run:

pytest tests_int -s --rootdir=/path/to/project/root
run_load_test(real_run: bool = True, verbose: bool = True)[source]

A wrapper of pytest command to run load test.

Run:

pytest tests_load -s --rootdir=/path/to/project/root