Skip to content

Configuration

The Nijam pytest plugin is configured with ini options under [pytest] in pytest.ini (or [tool.pytest.ini_options] in pyproject.toml). Every ini key is also overridable by an environment variable, and the environment variable wins when both are set - handy for keeping secrets out of the repo and varying per-pipeline values in CI. Only the API key and nijam_project_id are required; everything else has a sensible default. There are no test-code changes.

pytest.ini
[pytest]
nijam_project_id = b4fdfc06-76a2-4721-89eb-9d070add8a5a
Terminal window
export NIJAM_API_KEY=...
pytest.ini
[pytest]
nijam_project_id = b4fdfc06-76a2-4721-89eb-9d070add8a5a
nijam_environment = staging ; free-form deploy tag
nijam_upload_source = true ; upload test source for inline rendering
nijam_auto_complete = true ; finalize the run when the suite ends
nijam_silent = false ; suppress [nijam] log lines
; nijam_api_key / nijam_api_url are normally set via env vars instead

Each ini key has a matching environment variable; the env var takes precedence.

ini keyEnv varRequiredDefaultDescription
nijam_api_keyNIJAM_API_KEYyes-API key from the Nijam dashboard. Set it as a CI secret via the env var.
nijam_project_idNIJAM_PROJECT_IDyes-The project’s ID (UUID) from the dashboard.
nijam_api_urlNIJAM_API_URLnohttps://api.nijam.devAPI base URL. You don’t normally need to set this.
nijam_environmentNIJAM_ENVIRONMENTno-Free-form deploy tag (e.g. staging). Adds a run filter. Runs without it show as Unset.
nijam_upload_source-notrueUpload test source so the dashboard renders tests inline. Set false to opt out.
nijam_auto_completeNIJAM_AUTO_COMPLETEnotrueFinalize the run when the suite ends. Set false for fan-out CI.
nijam_silent-nofalseSuppress all [nijam] log lines.

For nijam_environment, see Environments. For nijam_upload_source, see Source. For nijam_auto_complete, see CI integration.

  • nijam_project_id - open your project in the dashboard and copy its Project ID.
  • API key - generate one in the project’s settings and set it as NIJAM_API_KEY in your CI secrets.

The plugin is built to never break your CI. If the API is unreachable, the key is wrong, or anything else goes sideways, it logs a [nijam] warning and lets the run finish exactly as it would without Nijam. Set nijam_silent = true to suppress even those warnings.

You don’t configure commit/branch/PR/author - the plugin auto-detects them from your CI provider’s environment variables, falling back to git.

pytest-nijam also installs a nijam-pytest CLI. nijam-pytest fetch-failed asks Nijam which tests failed in the previous run (by nodeid) so a retry runs only those, and clubs the attempts into one run on the dashboard:

Terminal window
nijam-pytest fetch-failed --output failed.txt --export-env "$GITHUB_ENV"
pytest $(cat failed.txt)

It reuses your NIJAM_API_KEY and NIJAM_PROJECT_ID. See Re-run only failed tests for the full per-provider CI recipe.