Skip to content

Make tests order independent #932

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions graphene_django/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import pytest

from graphene_django.settings import graphene_settings as gsettings

from .registry import reset_global_registry


@pytest.fixture(autouse=True)
def reset_registry_fixture(db):
yield None
reset_global_registry()


@pytest.fixture()
def graphene_settings():
settings = dict(gsettings.__dict__)
yield gsettings
gsettings.__dict__ = settings
7 changes: 0 additions & 7 deletions graphene_django/debug/tests/test_query.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import pytest

import graphene
from graphene.relay import Node
from graphene_django import DjangoConnectionField, DjangoObjectType
Expand All @@ -13,11 +11,6 @@ class context(object):
pass


# from examples.starwars_django.models import Character

pytestmark = pytest.mark.django_db


def test_should_query_field():
r1 = Reporter(last_name="ABA")
r1.save()
Expand Down
3 changes: 0 additions & 3 deletions graphene_django/filter/tests/test_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@
)
)

pytestmark.append(pytest.mark.django_db)


if DJANGO_FILTER_INSTALLED:

class ArticleNode(DjangoObjectType):
Expand Down
Loading