Skip to content

Commit 578c893

Browse files
committed
fix test
1 parent 6aac326 commit 578c893

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

src/validators/enum_.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use std::collections::HashSet;
21
// Validator for Enums, so named because "enum" is a reserved keyword in Rust.
32
use std::marker::PhantomData;
43

tests/validators/test_enums.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,6 @@ class MyEnum(Enum):
263263

264264

265265
def test_plain_enum_tuple():
266-
from pydantic import RootModel
267-
268266
class MyEnum(Enum):
269267
a = 1, 2
270268
b = 2, 3
@@ -273,9 +271,7 @@ class MyEnum(Enum):
273271
v = SchemaValidator(core_schema.enum_schema(MyEnum, list(MyEnum.__members__.values())))
274272
assert v.validate_python((1, 2)) is MyEnum.a
275273
assert v.validate_python((2, 3)) is MyEnum.b
276-
serialised = RootModel[MyEnum](MyEnum.a).model_dump_json()
277-
parsed = RootModel[MyEnum].model_validate_json(serialised)
278-
assert parsed.root is MyEnum.a
274+
assert v.validate_json('[1, 2]') is MyEnum.a
279275

280276

281277
def test_plain_enum_empty():

0 commit comments

Comments
 (0)