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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for pytest_external_blockers-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2e88ff2eaae943d1102372ba29fb8b464567d9e8bc18e89ad8785a2f0fea0de |
|
MD5 | dbb6b7149c5ea5c42c04a37a5de9a97b |
|
BLAKE2b-256 | c39954716ce822b804a40a132bfd502f8c89b42c932a79b923c6e7f7ae8f21d2 |
Close
Hashes for pytest_external_blockers-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d0ebdbf144bbc1540c5310438847ba59c940a920b3fe37149b62a70cda41bec |
|
MD5 | d9091a8ec506cd642c8b7796ebe47e29 |
|
BLAKE2b-256 | c7dd4f10ef823d98beb9de1f4787a0d4514f412724e878a847691f24de117d06 |