Skip to main content

Pytest Options

Pass these to pytest (or set in pytest.ini / pyproject.toml under addopts).

OptionDescription
--dagzEnable DAGZ test selection and coverage collection.
--dagz-skip-redundant=0/1Skip tests proven redundant by code analysis against the baseline. Tristate; default is inferred from admin config.
--dagz-workers N, -n NNumber of parallel worker processes; auto/logical = the default, calculated from your hardware. -n is pytest-xdist's flag: DAGZ reads it, xdist installed or not. --dist is accepted and ignored (DAGZ schedules tests itself).
--dagz-cov=0/1Incremental line coverage (also --dagz-incremental-line-coverage). Tristate; default is inferred from project config.
--dagz-cov-file PATHWrite a coverage report to PATH at the end of the run. Requires --dagz-cov-format.
--dagz-cov-format FMTpycoverage (.coverage SQLite, coverage.py-compatible) or xml (Cobertura). Requires --dagz-cov-file.
--cov, --cov-report=xml[:PATH], --no-covpytest-cov's flags, honored with or without pytest-cov installed: --cov turns incremental line coverage on, --cov-report=xml[:PATH] writes Cobertura XML (default coverage.xml), --no-cov turns it off. --cov-config, --cov-branch, --cov-append, --no-cov-on-fail and other report types are accepted and ignored; --cov-fail-under fails the run (unsupported).
--dagz-tiny-testsBatch test results for projects with many short tests.
--dagz-baseline REFUse a specific baseline (jMMDD.N or a uuid).
--dagz-no-baselineRun without loading any baseline.
--dagz-rerun-unhealthy JOBSRerun tests that weren't healthy in the given jobs.
--dagz-capture=0/1Override default settings for capturing stdout+stderr.
--dagz-offlineRun without contacting any DAGZ server.
--dagz-debugRun with full debug logs on the console.
--dagz-debug-1Run with full debug logs and a single worker.
--dagz-traceRun in trace mode with maximum verbosity.
--dagz-collect-log-level LEVELLowest log level collected to the dagz server: trace, debug, info, notice, warn, error, fatal (any case) or a number. It overrides the project config's log_collect_level (default warn); without it, --dagz-trace collects trace and --dagz-debug collects debug. DAGZ_TRACE=1 and DAGZ_DEBUG=1 override it. dagz's own records are collected at any level.
--dagz-web-tunnelTunnel worker traffic through the web port (TLS). Use when only the web port is reachable.
--dagz-collect-fixupWorkaround for pytest #12083 (collection fails when mixing file paths and directories).
--dagz-disable-sensorsDisable DAGZ instrumentation and integration hooks; run as plain pytest. Also --dagz-no-sensors.
--dagz-allow-any-osBypass the Linux-only platform check. Unsupported, may not work correctly.