Created
June 29, 2017 07:17
-
-
Save pgiraud/6966f2f456e56eb711d694adfd0decbf to your computer and use it in GitHub Desktop.
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
def test_mock_open(mocker): | |
with mocker.patch('builtins.open', mocker.mock_open(read_data='foo')): | |
with open(__file__) as f: | |
assert f.read() == 'foo' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment