Last active
December 14, 2015 23:08
-
-
Save flopezluis/5163129 to your computer and use it in GitHub Desktop.
Small example the how I'm using pytest
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
@pytest.fixture() | |
def foo_client(monkeypatch): | |
def authenticate(): | |
pass | |
monkeypatch.setattr(FooClient, "authenticate", authenticate) | |
return FooClient("token", "secret") | |
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_add_data(foo_client): | |
foo_client.add_data(["shuttlecloud.com"]) | |
assert "shuttlecloud.com" in foo_client.get_data() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment