Skip to content

Instantly share code, notes, and snippets.

@hackebrot
Last active August 3, 2016 07:18
Show Gist options
  • Save hackebrot/97c1722db204580615d0ca33ad444635 to your computer and use it in GitHub Desktop.
Save hackebrot/97c1722db204580615d0ca33ad444635 to your computer and use it in GitHub Desktop.
Report tests as failures
# -*- 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