Created
December 9, 2018 13:41
-
-
Save madsmtm/32db9e6b4a466835b58696e04e3e3086 to your computer and use it in GitHub Desktop.
Graphene pytest fixtures
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
from pytest import fixture | |
from graphene.test import Client | |
@fixture(scope="session") | |
def _schema(): | |
raise NotImplementedError( | |
"You must implement this fixture yourself." | |
"It should return an instance of `graphene.Schema`" | |
) | |
@fixture | |
def client(_schema): | |
return Client(_schema) | |
@fixture | |
def execute(client): | |
return client.execute | |
@fixture | |
def format_result(client): | |
return client.format_result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment