Skip to content

Instantly share code, notes, and snippets.

@laurentsenta
Last active February 5, 2016 10:20
Show Gist options
  • Save laurentsenta/3780003fe1d259f422ed to your computer and use it in GitHub Desktop.
Save laurentsenta/3780003fe1d259f422ed to your computer and use it in GitHub Desktop.
pytest not calling hooks with TestCase
import pytest
@pytest.hookimpl(hookwrapper=True)
def pytest_pyfunc_call(pyfuncitem):
1 / 0
outcome = yield
from unittest import TestCase
class TestX(TestCase):
def test_should_fail_with_divby0(self):
assert False, "The hook didn't get called"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment