Created
November 26, 2012 22:12
-
-
Save blaix/4150999 to your computer and use it in GitHub Desktop.
Patching an entire test class in python
This file contains 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
from unittest import TestCase | |
from mock import patch | |
from my.module import MyClass | |
@patch("my.module.OtherClass") | |
class TestMyClass(TestCase): | |
def test_something(self, mocked_other_class): | |
assert "Justin is awesome" | |
def test_something_else(self, mocked_other_class): | |
assert "So is Dan" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment