Skip to main content

a special outcome for tests that are blocked for external reasons

Project description

A pytest outcome for tests you dont run for external/environmental reason.

examples of such reasons reasons are:

  • lack of access to a bugtracker telling you what tests apply for the current version of software under test
  • lack of access to a backend service providing essential details for the tests in question
  • issue in a bugtracker is unresolved
  • failure of the internet connection

install

$ pip install pytest-external-blockers

use

import os
import pytest
from .issues import get_tracker

pytestmark = pytest.mark.skipif(
    "BUGTRACKER" in os.environ,
    reason="no bugtracker configured")

@pytest.fixture(scope="session")
def bugtracker():
    try:
        return get_tracker():
    except Exception:
        pytest.block("bugtracker unavailiable")


@pytest.fixture(autouse=True)
def _block_unresolved(request, bugtracker):
    issue = request.node.getmarker('issue')
    if issue is not None:
        for issue_id in issue.args:
            if bugtracker.is_unresolved(issue_id)
                pytest.block(
                    "{issue_id} was not resolved".format(issue_id))

Project details


Download files

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

Files for pytest-external-blockers, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size pytest_external_blockers-0.1.1.tar.gz (7.0 kB) File type Source Python version None Upload date Hashes View
Filename, size pytest_external_blockers-0.1.1-py3-none-any.whl (4.3 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page