possible test fix

This commit is contained in:
Elijah 2024-10-25 16:41:35 +00:00
parent a6530a7e78
commit e6fd6deed2

View File

@ -1,6 +1,8 @@
import pytest import pytest
from reflex.utils.exceptions import InvalidPropValueError from pydantic import ValidationError
from reflex.components.props import NoExtrasAllowedProps from reflex.components.props import NoExtrasAllowedProps
from reflex.utils.exceptions import InvalidPropValueError
class PropA(NoExtrasAllowedProps): class PropA(NoExtrasAllowedProps):
@ -50,7 +52,7 @@ class PropB(NoExtrasAllowedProps):
) )
def test_no_extras_allowed_props(props_class, kwargs, should_raise): def test_no_extras_allowed_props(props_class, kwargs, should_raise):
if should_raise: if should_raise:
with pytest.raises(InvalidPropValueError): with pytest.raises((InvalidPropValueError, ValidationError)):
props_class(**kwargs) props_class(**kwargs)
else: else:
props_instance = props_class(**kwargs) props_instance = props_class(**kwargs)