Last active
August 3, 2016 07:18
-
-
Save hackebrot/97c1722db204580615d0ca33ad444635 to your computer and use it in GitHub Desktop.
Report tests as failures
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import random | |
import pytest | |
@pytest.hookimpl(hookwrapper=True) | |
def pytest_runtest_makereport(item): | |
outcome = yield | |
rep = outcome.get_result() | |
if random.randint(0, 100) < 30: | |
rep.outcome = 'failed' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment