Testing#

SalesPyForce tests are organized into:

  • tests/unit/ for fast, deterministic unit tests

  • tests/integration/ for opt-in tests that require real helper credentials

Run the Test Suite#

Install dependencies and run all tests:

poetry install
poetry run pytest -q

Run only unit tests:

poetry run pytest tests/unit -q

Integration Tests#

Integration tests are opt-in and require helper credentials. To include them:

poetry run pytest --integration tests/integration -q

If no helper file is available, integration tests are skipped automatically.

Coverage#

Run coverage locally with:

poetry run pytest --cov-report=xml --cov=salespyforce --cov-fail-under=50 tests/unit tests/integration --color=yes

The --cov-fail-under=50 threshold matches CI and fails the run if total coverage drops below 50%.