Skip to content

Commit

Permalink
changes in capyc directories
Browse files Browse the repository at this point in the history
  • Loading branch information
jefer94 committed Aug 29, 2024
1 parent d9b9b48 commit 18e226f
Show file tree
Hide file tree
Showing 30 changed files with 42 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import pytest
from asgiref.sync import sync_to_async

import capyc.core.pytest.fixtures as cfx
import capyc.django.pytest.fixtures as dfx
import capyc.pytest.core.fixtures as cfx
import capyc.pytest.django.fixtures as dfx
from breathecode.monitoring.models import Supervisor as SupervisorModel
from breathecode.monitoring.models import SupervisorIssue
from breathecode.tests.mixins.breathecode_mixin.breathecode import Breathecode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import pytest
from asgiref.sync import sync_to_async

import capyc.core.pytest.fixtures as cfx
import capyc.django.pytest.fixtures as dfx
import capyc.pytest.core.fixtures as cfx
import capyc.pytest.django.fixtures as dfx
from breathecode.monitoring.models import Supervisor as SupervisorModel
from breathecode.monitoring.models import SupervisorIssue
from breathecode.payments.supervisors import supervise_all_consumption_sessions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from django.utils import timezone

from breathecode.tests.mixins.breathecode_mixin.breathecode import Breathecode
from capyc.django.pytest.fixtures import QuerySet
from capyc.pytest.django.fixtures import QuerySet

from ...tasks import refund_mentoring_session

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from rest_framework import status

from breathecode.tests.mixins.breathecode_mixin.breathecode import Breathecode
from capyc.rest_framework.pytest import fixtures as rfx
from capyc.pytest.rest_framework import fixtures as rfx


@pytest.fixture(autouse=True)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Centralized Breathecode fixtures for all our libraries."""

from capyc.core.pytest import * # noqa: F401
from capyc.pytest.core import * # noqa: F401

from .fixtures import * # noqa: F401
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions capyc/pytest/rest_framework/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Centralized Breathecode fixtures for all our libraries."""

from capyc.pytest.django import * # noqa: F401

from .fixtures import * # noqa: F401
3 changes: 3 additions & 0 deletions capyc/pytest/rest_framework/fixtures/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""Centralized Breathecode fixtures for all our libraries."""

from .client import * # noqa: F401
19 changes: 19 additions & 0 deletions capyc/pytest/rest_framework/fixtures/client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""
QuerySet fixtures.
"""

import pytest
from adrf.test import AsyncAPIClient as AsyncClient
from rest_framework.test import APIClient as Client

__all__ = ["client", "aclient", "Client", "AsyncClient"]


@pytest.fixture
def client():
return Client()


@pytest.fixture
def aclient():
return AsyncClient()
2 changes: 1 addition & 1 deletion capyc/rest_framework/pytest/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Centralized Breathecode fixtures for all our libraries."""

from capyc.django.pytest import * # noqa: F401
from capyc.pytest.django import * # noqa: F401

from .fixtures import * # noqa: F401
14 changes: 7 additions & 7 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@

from breathecode.notify.utils.hook_manager import HookManagerClass
from breathecode.utils.exceptions import TestError
from capyc.core.pytest.fixtures import Random
from capyc.django.pytest.fixtures.signals import Signals
from capyc.pytest.core.fixtures import Random
from capyc.pytest.django.fixtures.signals import Signals

# set ENV as test before run django
os.environ["ENV"] = "test"
os.environ["DATABASE_URL"] = "sqlite:///:memory:"

pytest_plugins = (
"capyc.core.pytest",
"capyc.newrelic.pytest",
"capyc.django.pytest",
"capyc.rest_framework.pytest",
"capyc.circuitbreaker.pytest",
"capyc.pytest.core",
"capyc.pytest.newrelic",
"capyc.pytest.django",
"capyc.pytest.rest_framework",
"capyc.pytest.circuitbreaker",
)

from breathecode.tests.mixins.breathecode_mixin import Breathecode
Expand Down

0 comments on commit 18e226f

Please sign in to comment.