|
@@ -1,12 +1,17 @@
|
|
from typing import Dict, List, Set, Tuple
|
|
from typing import Dict, List, Set, Tuple
|
|
|
|
|
|
import pytest
|
|
import pytest
|
|
-from pydantic import ValidationError
|
|
|
|
|
|
|
|
from reflex.components import box, foreach, text, theme
|
|
from reflex.components import box, foreach, text, theme
|
|
from reflex.components.core import Foreach
|
|
from reflex.components.core import Foreach
|
|
from reflex.state import BaseState
|
|
from reflex.state import BaseState
|
|
|
|
|
|
|
|
+try:
|
|
|
|
+ # When pydantic v2 is installed
|
|
|
|
+ from pydantic.v1 import ValidationError # type: ignore
|
|
|
|
+except ImportError:
|
|
|
|
+ from pydantic import ValidationError
|
|
|
|
+
|
|
|
|
|
|
class ForEachState(BaseState):
|
|
class ForEachState(BaseState):
|
|
"""A state for testing the ForEach component."""
|
|
"""A state for testing the ForEach component."""
|