Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit bf0aaae

Browse files
committedOct 23, 2023
fix: mark test as pydantic v1 only
1 parent 2e115dd commit bf0aaae

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
 

‎tests/functional/event_handler/test_openapi_encoders.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
from dataclasses import dataclass
22
from typing import List
33

4+
import pytest
45
from pydantic import BaseModel
56
from pydantic.color import Color
67

78
from aws_lambda_powertools.event_handler.openapi.encoders import jsonable_encoder
89

910

11+
@pytest.fixture
12+
def pydanticv1_only():
13+
from pydantic import __version__
14+
15+
version = __version__.split(".")
16+
if version[0] != "1":
17+
pytest.skip("pydanticv1 test only")
18+
19+
1020
def test_openapi_encode_include():
1121
class User(BaseModel):
1222
name: str
@@ -37,6 +47,7 @@ class User(BaseModel):
3747
assert result == {"name": "John", "order": {"quantity": 2}}
3848

3949

50+
@pytest.mark.usefixtures("pydanticv1_only")
4051
def test_openapi_encode_pydantic_root_types():
4152
class User(BaseModel):
4253
__root__: List[str]

0 commit comments

Comments
 (0)
Please sign in to comment.