Skip to main content

Real-time pytest reporter for UTEM Core — streams test results as tests run

Project description

UTEM Reporter for pytest

Streams pytest test results to UTEM Core in real time as tests run. Zero external dependencies — uses only the Python standard library.

Installation

pip install utem-pytest-reporter

Usage

Once installed the plugin is auto-discovered by pytest — no changes to conftest.py or pytest.ini needed.

# Point to your UTEM Core server
UTEM_SERVER_URL=http://localhost:8080/utem pytest

# Or use the command-line option
pytest --utem-url=http://localhost:8080/utem

Configuration

Environment Variables / CLI

Environment Variable CLI option Description Default
UTEM_SERVER_URL --utem-url UTEM Core server URL http://localhost:8080/utem
UTEM_RUN_NAME Custom name for the test run pytest session name
UTEM_RUN_LABEL Label to tag the run (e.g. regression, smoke) (none)
UTEM_JOB_NAME CI job name (e.g. Jenkins build name) (none)
UTEM_DISABLED Set to true to disable the reporter entirely false

Example:

UTEM_SERVER_URL=http://myserver:8080/utem \
UTEM_RUN_NAME="Checkout E2E Suite" \
UTEM_RUN_LABEL="regression" \
pytest

Config File (utem.config.json)

For settings that apply whenever you run tests (including directly from your IDE), create a utem.config.json file in your project root:

{
  "serverUrl": "http://myserver:8080/utem",
  "runName": "My Test Suite",
  "runLabel": "regression",
  "jobName": "nightly",
  "disabled": false
}
Key Description Default
serverUrl UTEM Core server URL http://localhost:8080/utem
runName Custom name for the test run pytest session name
runLabel Label to tag the run (none)
jobName CI job name (none)
disabled Set to true to disable the reporter entirely false

Priority order: --utem-url CLI → Environment variable → utem.config.json → built-in default.

Disabling the Reporter

Sometimes you want to run tests without sending results to UTEM (e.g. during local development or when running individual tests from the IDE).

Option 1 — environment variable (one-off):

UTEM_DISABLED=true pytest

Option 2 — utem.config.json (always disabled until you change it back):

Create utem.config.json in your project root:

{
  "disabled": true
}

When disabled, the reporter prints a single log line and sends no HTTP requests to the UTEM server.

Screenshot Support (Selenium)

Register your WebDriver in a fixture to get automatic screenshots on failure:

import pytest
import utem_pytest_reporter

@pytest.fixture(autouse=True)
def utem_driver(driver):
    utem_pytest_reporter.register_driver(driver)
    yield
    utem_pytest_reporter.unregister_driver()

Screenshots are automatically attached to the failing test in the UTEM dashboard.

What Gets Reported

pytest event UTEM event
Session start TEST_RUN_STARTED
First test in a file TEST_SUITE_STARTED
Each test start TEST_CASE_STARTED
Test pass TEST_PASSED + TEST_CASE_FINISHED
Test failure TEST_FAILED + TEST_CASE_FINISHED
Test skip TEST_SKIPPED + TEST_CASE_FINISHED
Session end TEST_SUITE_FINISHED × N + TEST_RUN_FINISHED
Failure screenshot ATTACHMENT + file upload

Requirements

  • Python 3.8+
  • pytest 7+
  • UTEM Core server running

Quickstart with Docker:

docker run -d -p 8080:8080 --name utem-core sddmhossain/utem-core

See UTEM Core for full setup options.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

utem_pytest_reporter-0.1.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

utem_pytest_reporter-0.1.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file utem_pytest_reporter-0.1.0.tar.gz.

File metadata

  • Download URL: utem_pytest_reporter-0.1.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for utem_pytest_reporter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e3e8a38e464df3d6d4a8dd6a60e2088791f3ac66a06eec4b7ab0568cf9425d7c
MD5 01e434c8c66252acdd320d4a04df9b10
BLAKE2b-256 d383828b5b1572d66e3fb94aea5db52c2317ecc8187001144017687a509d5beb

See more details on using hashes here.

File details

Details for the file utem_pytest_reporter-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for utem_pytest_reporter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 617cb8619bd121c7d8b1f6717da2c65b784da5499488e7edf3e0d2a732cb0432
MD5 035e70d2fa1a3a7ee97ab3dc8fbf40a6
BLAKE2b-256 01ad0943679938e328ecd5e7cb8bfb15b91931349420eaaa5e1337f254e306a4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page