Skip to main content

No project description provided

Project description

pytest-publish

pytest-publish is a simple pytest plugin for publishing test results mid-session.

Useful for live applications running on top of pytest (UI, logstash, etc).

Usage

Only requirement is a target REST API endpoint to report test results to, e.g:

$ pytest --publish http://localhost:7777/test-update

On each test result, an HTTP POST request with the following JSON data will be submitted:

{
    "type": "result",
    "result": ...,  # pass|fail|skip
    "nodeid": "<test item nodeid>",  # includes test name
    "start_time": 0.0,  # start time epoch seconds
    "stop_time": 0.1,   # end time epoch seconds
    "duration": 0.1,    # test duration seconds
    "stdout": "hello, world!",  # captured stdout
    "stderr": "WARN: ...", # captured stderr
    "log": "ERROR root:0:0 bad log",  # captured logs (logging lib)
    "xdist_worker": None or "gw0",  # worker name if running on xdist or None otherwise

    # only if "result" != "pass":
    "excinfo": {
        "type": "AssertionError", # exception type name
        "value": "assert False", # exception value string
        "traceback": [  # traceback lines
            "File .. in ..:\n  func()",
            "File .. in ..:\n  assert False"
        ]
    }
}

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

pytest_publish-1.0.0.tar.gz (2.1 kB view hashes)

Uploaded Source

Built Distribution

pytest_publish-1.0.0-py3-none-any.whl (2.5 kB view hashes)

Uploaded Python 3

Supported by

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