Skip to content
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

chore: Fix Pydantic misbehaving with Freezegun #3871

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions api/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
from projects.tags.models import Tag
from segments.models import Condition, Segment, SegmentRule
from task_processor.task_run_method import TaskRunMethod
from tests.test_helpers import fix_issue_3869
from tests.types import (
WithEnvironmentPermissionsCallable,
WithOrganisationPermissionsCallable,
Expand All @@ -79,6 +80,10 @@ def pytest_addoption(parser: pytest.Parser) -> None:
)


def pytest_sessionstart(session: pytest.Session) -> None:
fix_issue_3869()


@pytest.hookimpl(trylast=True)
def pytest_configure(config: pytest.Config) -> None:
if (
Expand Down
7 changes: 7 additions & 0 deletions api/tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,10 @@ def generate_segment_data(
}
],
}


def fix_issue_3869():
import freezegun # noqa
import pydantic._internal._generate_schema # noqa

freezegun.configure(extend_ignore_list=["pydantic._internal._generate_schema"])