Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ronnypfannschmidt/pytest-external-blockers
https://github.com/ronnypfannschmidt/pytest-external-blockers
Last synced: 23 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ronnypfannschmidt/pytest-external-blockers
- Owner: RonnyPfannschmidt
- License: mit
- Created: 2016-09-30T06:52:46.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2024-10-21T20:41:06.000Z (30 days ago)
- Last Synced: 2024-10-22T15:28:40.439Z (29 days ago)
- Language: Python
- Size: 31.3 KB
- Stars: 5
- Watchers: 3
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
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 connectioninstall
-------::
$ pip install pytest-external-blockers
use
---.. code-block:: python
import os
import pytest
from .issues import get_trackerpytestmark = 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))