Skip to content

Commit d61f8db

Browse files
author
desert
committed
Skip on 3.6 because isinstance(t.Sequence[int], type).
1 parent df3dafb commit d61f8db

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/desert/_make.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ def class_schema(clazz: type, meta: Dict[str, Any] = {}) -> Type[marshmallow.Sch
102102
"""
103103

104104
fields: Union[Tuple[dataclasses.Field], Tuple[attr.Attribute]]
105+
105106
if not isinstance(clazz, type):
106107
raise desert.exceptions.UnknownType(
107108
f"Desert failed to infer the field type for {clazz}.\n"

tests/test_make.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import dataclasses
22
import datetime
33
import enum
4+
import sys
45
import types
56
import typing as t
67

@@ -357,6 +358,9 @@ class A:
357358
desert.schema_class(A)
358359

359360

361+
@pytest.mark.skipif(
362+
sys.version_info[:2] <= (3, 6), reason="3.6 has isinstance(t.Sequence[int], type)."
363+
)
360364
def test_raise_unknown_generic(module):
361365
"""Raise UnknownType for unknown generics."""
362366

0 commit comments

Comments
 (0)