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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b6ee95f6584c88e1d70cc9c969e0c3f6cfa5a8002b9693f46949b928e84a872 |
|
MD5 | 14c3b5bb91362e8af3d177dce610be94 |
|
BLAKE2b-256 | bda841e750cf48af4a01607225ea0ab1d1deb93e4025ff5402c8653af6b0725e |
Close
Hashes for pytest_external_blockers-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff5aff0fd7384af38dc9a1143c81bc2cd0bf12d19d2b933b7acbfa207e851493 |
|
MD5 | 0595f86b8d695d750443a96b4d04cd15 |
|
BLAKE2b-256 | edfdb5783e04e152fa8d4b039d14f1eb0c349b3e591432b84daa1ab65ab1eccf |