qase-python-commons: A library for Qase TestOps and Qase Report · Pythie
Qase Python Commons
Core library for all Qase Python reporters. Contains the complete configuration reference.
Table of Contents
About This module is an SDK for developing test reporters for Qase TMS. It uses qase-api-client as an API client, and all Qase Python reporters depend on this package.
You're developing a custom reporter for a specialized framework
You need a complete configuration reference
For testing, use the ready-made reporters — see Reporters section.
Installation pip install qase-python-commons
Reporters For popular frameworks, use the ready-made reporters:
Framework Package Documentation Pytest qase-pytestREADME Behave qase-behaveREADME Robot Framework qase-robotframeworkREADME Tavern qase-tavernREADME
Configuration
Configuration Priority Qase Python reporters support three configuration methods (in order of priority):
CLI options (pytest and tavern only) — highest priority
Environment variables (QASE_*)
Config file (qase.config.json) — lowest priority
Reporter Modes The reporter mode is set via the mode option:
Mode Description testopsSend results to a single Qase project testops_multiSend results to multiple projects reportGenerate a local JSON report offReporter disabled (default)
Common Options Description Config file Environment variable Default Required Reporter mode modeQASE_MODEoffNo Fallback mode fallbackQASE_FALLBACKoffNo Environment environmentQASE_ENVIRONMENT— No Root suite rootSuiteQASE_ROOT_SUITE— No Debug mode debugQASE_DEBUGFalseNo Execution plan path executionPlan.pathQASE_EXECUTION_PLAN_PATH./build/qase-execution-plan.jsonNo Exclude parameters excludeParamsQASE_EXCLUDE_PARAMS— No Status mapping statusMappingQASE_STATUS_MAPPING— No
TestOps Options (Single Project) Description Config file Environment variable Default Required API token testops.api.tokenQASE_TESTOPS_API_TOKEN— Yes* Qase API host. qase.io is the US cluster; set eu.qase.io if your workspace is on the EU cluster (you open Qase at app-eu.qase.io) testops.api.hostQASE_TESTOPS_API_HOSTqase.ioYes, on the EU cluster Request timeout, seconds testops.api.timeoutQASE_TESTOPS_API_TIMEOUT30No Upload attempts testops.api.retriesQASE_TESTOPS_API_RETRIES3No Retry backoff base, seconds testops.api.retryBackoffQASE_TESTOPS_API_RETRY_BACKOFF2No Project code testops.projectQASE_TESTOPS_PROJECT— Yes* Test run ID testops.run.idQASE_TESTOPS_RUN_ID— No Test run title testops.run.titleQASE_TESTOPS_RUN_TITLEAutomated run <date>No Test run description testops.run.descriptionQASE_TESTOPS_RUN_DESCRIPTION<Framework> automated runNo Complete test run testops.run.completeQASE_TESTOPS_RUN_COMPLETETrueNo Test run tags testops.run.tagsQASE_TESTOPS_RUN_TAGS[]No External link testops.run.externalLinkQASE_TESTOPS_RUN_EXTERNAL_LINK— No Test plan ID testops.plan.idQASE_TESTOPS_PLAN_ID— No Batch size testops.batch.sizeQASE_TESTOPS_BATCH_SIZE200No Create defects testops.defectQASE_TESTOPS_DEFECTFalseNo Status filter testops.statusFilterQASE_TESTOPS_STATUS_FILTER— No Configuration values testops.configurations.valuesQASE_TESTOPS_CONFIGURATIONS_VALUES— No Create configurations testops.configurations.createIfNotExistsQASE_TESTOPS_CONFIGURATIONS_CREATE_IF_NOT_EXISTSfalseNo Show public report link testops.showPublicReportLinkQASE_TESTOPS_SHOW_PUBLIC_REPORT_LINKFalseNo
* Required when using testops mode
TestOps Multi Options (Multiple Projects) Description Config file Environment variable Default Required Default project testops_multi.default_projectQASE_TESTOPS_MULTI_DEFAULT_PROJECT— No Projects array testops_multi.projects— []Yes** Project code testops_multi.projects[].code— — Yes** Test run title testops_multi.projects[].run.title— Automated Run <code> <date>No Test run description testops_multi.projects[].run.description— Automated Run <code> <date>No Complete test run testops_multi.projects[].run.complete— TrueNo Test run ID testops_multi.projects[].run.id— — No Test run tags testops_multi.projects[].run.tags— []No External link testops_multi.projects[].run.externalLink— — No Test plan ID testops_multi.projects[].plan.id— — No Environment testops_multi.projects[].environment— Global No
** Required when using testops_multi mode
Multi-project annotations:
Framework Syntax Pytest @qase.project_id("CODE", 1, 2, 3)Behave @qase.project_id.CODE:1,2,3Robot Framework Q-PROJECT.CODE-1,2,3Tavern QaseProjectID.CODE=1,2,3 in test name
Local Report Options Description Config file Environment variable Default Driver report.driverQASE_REPORT_DRIVERlocalReport path report.connection.pathQASE_REPORT_CONNECTION_PATH./build/qase-reportReport format report.connection.formatQASE_REPORT_CONNECTION_FORMATjson
Logging Options Description Config file Environment variable Default Console output logging.consoleQASE_LOGGING_CONSOLETrueFile output logging.fileQASE_LOGGING_FILESame as debug
Framework-Specific Options
Pytest Description Config file Environment variable CLI Default Capture logs framework.pytest.captureLogsQASE_PYTEST_CAPTURE_LOGS--qase-pytest-capture-logsFalseXFail status (failed) framework.pytest.xfailStatus.xfailQASE_PYTEST_XFAIL_STATUS_XFAIL--qase-pytest-xfail-status-xfailSkippedXFail status (passed) framework.pytest.xfailStatus.xpassQASE_PYTEST_XFAIL_STATUS_XPASS--qase-pytest-xfail-status-xpassPassed
Behave, Robot Framework, Tavern These frameworks use only the common configuration options.
Configuration Examples
Single Project (testops) {
"mode": "testops",
"fallback": "report",
"debug": false,
"environment": "local",
"testops": {
"api": {
"token": "<token>",
"host": "qase.io"
},
"project": "DEMO",
"run": {
"title": "Regress run",
"description": "Automated regression tests",
"complete": true,
"tags": ["regression", "automated"]
},
"batch": {
"size": 100
}
}
}
Multiple Projects (testops_multi) {
"mode": "testops_multi",
"fallback": "report",
"testops": {
"api": {
"token": "<token>",
"host": "qase.io"
},
"batch": {
"size": 100
}
},
"testops_multi": {
"default_project": "DEMO1",
"projects": [
{
"code": "DEMO1",
"run": {
"title": "DEMO1 Test Run",
"tags": ["staging"]
},
"environment": "staging"
},
{
"code": "DEMO2",
"run": {
"title": "DEMO2 Test Run",
"tags": ["production"]
},
"environment": "production"
}
]
}
}
Environment Variables # Common settings
export QASE_MODE="testops"
export QASE_FALLBACK="report"
export QASE_ENVIRONMENT="local"
export QASE_DEBUG="false"
# TestOps
export QASE_TESTOPS_API_TOKEN="<token>"
export QASE_TESTOPS_API_HOST="qase.io" # eu.qase.io for the EU cluster
export QASE_TESTOPS_PROJECT="DEMO"
export QASE_TESTOPS_RUN_TITLE="Automated Run"
export QASE_TESTOPS_RUN_COMPLETE="true"
export QASE_TESTOPS_API_TIMEOUT="30"
export QASE_TESTOPS_API_RETRIES="3"
export QASE_TESTOPS_API_RETRY_BACKOFF="2"
# Pytest
export QASE_PYTEST_CAPTURE_LOGS="true"
Profilers Profilers automatically track operations during test execution and send them as steps to Qase TestOps.
Enable profilers in qase.config.json:
{
"profilers": ["network", "db"]
}
Or via environment variable:
export QASE_PROFILERS="network,db"
The profilers array supports both string and object formats. Use the object format to configure profiler-specific options:
{
"profilers": [
{
"name": "network",
"excludeHosts": ["telemetry.local", "monitoring.internal"]
},
"db"
]
}
Additional Features
Status Mapping Allows changing test result status before sending to Qase:
{
"statusMapping": {
"invalid": "failed",
"skipped": "passed"
}
}
Available statuses: passed, failed, skipped, invalid
Status Filtering Excludes results with specified statuses from being sent:
{
"testops": {
"statusFilter": ["passed", "skipped"]
}
}
External Links Associates the test run with external resources (e.g., Jira):
{
"testops": {
"run": {
"externalLink": {
"type": "jiraCloud",
"link": "PROJ-123"
}
}
}
}
Types: jiraCloud, jiraServer
Test Run Configurations Creates or finds configurations in Qase TestOps:
{
"testops": {
"configurations": {
"values": [
{ "name": "browser", "value": "chrome" },
{ "name": "os", "value": "linux" }
],
"createIfNotExists": true
}
}
}
Upload Reliability Results are uploaded in batches from background threads. A batch that fails on
a transient error is retried rather than dropped.
Setting Meaning testops.api.timeoutPer-request timeout in seconds. Without it a stalled connection blocks the session at teardown. testops.api.retriesTotal attempts per batch, not retries on top of the first. 3 means three tries; 0 sends once and never retries. testops.api.retryBackoffBase of the exponential delay: attempt n waits retryBackoff ** n seconds.
Retried: connection resets, timeouts and other transport failures, plus HTTP
408, 429 and 5xx. Not retried: 400, 401, 403, 404, 413, 422 and 507 — a second
attempt fails identically and only adds load.
When a 429 carries a Retry-After header, that value replaces the computed
backoff. Qase sends roughly 60 seconds, so a run that hits the rate limit takes
longer to finish rather than losing the batch.
The same timeout and retry settings apply to attachment uploads, which go
through the API v1 client in batches of up to 20 files. If an attachment batch
cannot be uploaded after all attempts , the reporter logs an error, drops those
attachments and still submits the results they belong to — a failed attachment
never costs you the test results.
If a batch cannot be delivered after all attempts , the reporter logs an
error naming how many results were lost and does not mark the run complete .
An open run is the signal that its data is incomplete; a completed run over
partial results would look trustworthy and not be. In testops_multi mode this
is per project — one project's failure does not stop the others completing.
{
"testops": {
"api": {
"token": "<token>",
"timeout": 30,
"retries": 3,
"retryBackoff": 2
}
}
}
Requirements
Python 3.9+
qase-api-client
License Popularity
Downloads, last 7 days 33.9K-21%
Stars, last 7 days –
Direct dependents 4
All dependents 5 85
Healthy
Maintenance, out of 100
Recent release
last release 29 days ago
Commit activity
14/26 weeks with commits
Release cadence
21 releases in 12 months
Issues & PRs handled
94% closed in the past year
Contributor spread
2 authors in last 100 commits
Releases
Latest 5.1.7
Released Oct 30, 2026
Releases, 12 months 21
First release Dec 4, 2022 Compatibility
Requires Python >=3.9
Tested on 3.9 · 3.10 · 3.11 · 3.12 · 3.13
License non-standard (Other)
Same project Also published from qase-tms/qase-python.
qase-api-client Qase TestOps API V1 client for Python qase-api-v2-client Qase TestOps API V2 client for Python qase-pytest Qase Pytest Plugin for Qase TestOps and Qase Report