Skip to main content

Core runtime for the Opovid testing library.

Project description

Opovid Python Runtime

This directory contains the Python runtime for Opovid.

The first Python slice ships the framework-agnostic core plus the shared remembered-state ability:

  • Actor and the preferred User facade
  • task, question, and check helpers
  • with_retry for wrapping flaky or eventually-consistent tasks
  • nested execution reports and timeline events
  • render_timeline, timeline_to_json, and summarize_failure diagnostics
  • listener hooks for step boundaries
  • RememberTheState for small actor-local state

Install Locally

From this directory:

python3 -m pip install -e .

Basic Usage

from opovid import Actor, RememberTheState, remembered_by, question, task

casey = Actor.named("Casey").can(RememberTheState.using_defaults())

casey.attempts_to(
    task("remembers a subscription", lambda actor: remembered_by(actor).remember("plan", "pro"))
)

plan = casey.asks_for(question("reads the selected plan", lambda actor: remembered_by(actor).recall("plan")))

assert plan == "pro"

Module Layout

The Python runtime follows the same concept boundaries as the TypeScript, Java, and Ruby runtimes:

  • actor.py, user.py, and attempt_chain.py own the user/actor flow.
  • task.py, question.py, and check.py keep the executable contracts separate.
  • execution.py and execution_options.py own reports, timelines, errors, listeners, and execution options.
  • timeline.py owns text/JSON timeline rendering and failure summaries.
  • retry.py owns retry task wrappers.
  • actor_memory.py, remember_the_state.py, and memory.py provide the shared remembered-state ability.
  • core.py and __init__.py are public re-export entrypoints.

The Python runtime does not currently include the scenario spec module available in the TypeScript, Java, and Ruby runtimes.

Run Tests

From this directory:

PYTHONPATH=src python3 -m unittest discover -s tests

Lint And Format

Ruff is the Python runtime's linter and formatter.

python3 -m pip install -e ".[dev]"
ruff check .
ruff format --check .

Publish

The Python runtime publishes as opovid on PyPI.

Tagged releases are handled by the root GitLab release pipeline. The Python release job builds the source distribution and wheel, checks them with Twine, and uploads with PyPI Trusted Publishing through GitLab OIDC. Configure the PyPI trusted publisher for the sunrise.water/opovid GitLab project, the top-level .gitlab-ci.yml workflow, and the release environment before the first publish.

Browser flows remain intentionally centered in the TypeScript runtime with Playwright. The Python runtime is currently focused on service, request, job, and plain unit/integration flows.

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

opovid-0.1.7.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

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

opovid-0.1.7-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file opovid-0.1.7.tar.gz.

File metadata

  • Download URL: opovid-0.1.7.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for opovid-0.1.7.tar.gz
Algorithm Hash digest
SHA256 08982fc22a79426dcfb47f8724a5a4a2bd37c23c12307e97d7d6590a70067400
MD5 ecab440ac63b1fad3710d623001a1e4b
BLAKE2b-256 5d6a19745e28599376c99ec242777b2aa5459a5f6429482f5d6b01181158f1b8

See more details on using hashes here.

File details

Details for the file opovid-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: opovid-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for opovid-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 dfe9f26de98e404fca920ba8cc5fc2a75b9d94ffbd489a25e61d25a32ac2f29b
MD5 42206c51ef2d94ac933e2a40e614154a
BLAKE2b-256 0c3ab39dbad469da4fb9b2b90389ee34fa900f115d8464e6aa9e8d2129aacebb

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