a special outcome for tests that are blocked for external reasons
Project description
pytest-external-blockers
========================
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.skipifif(
"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))
========================
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.skipifif(
"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
Close
Hashes for pytest-external-blockers-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c740732681de8cbc882c15b61550aeecc474d1a3d5efcaffda4ebcbe1cfd9cf0 |
|
MD5 | fef16a8dcf13ddee24510aadef6dbd82 |
|
BLAKE2b-256 | 6fcabbf2561fa4f2dfab2e549da48aaee83e386c0500288bee34392d3ad722b2 |