File tree 2 files changed +6
-7
lines changed 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -323,7 +323,7 @@ def should_render(self, new: ContextProvider[_StateType]) -> bool:
323
323
return False
324
324
325
325
def __repr__ (self ) -> str :
326
- return f"{ type (self ).__name__ } ({ self .type !r } )"
326
+ return f"{ type (self ).__name__ } ({ self .type } )"
327
327
328
328
329
329
_ActionType = TypeVar ("_ActionType" )
Original file line number Diff line number Diff line change @@ -934,9 +934,8 @@ def ComponentUsesContext():
934
934
935
935
936
936
def test_context_repr ():
937
- sample_context = idom .Context ("sample_context" , None )
938
- assert repr (sample_context ) == "Context('sample_context')"
939
- assert repr (sample_context ()) == "ContextProvider('sample_context')"
937
+ sample_context = idom .create_context (None )
938
+ assert repr (sample_context ()) == f"ContextProvider({ sample_context } )"
940
939
941
940
942
941
async def test_use_context_only_renders_for_value_change ():
@@ -1065,8 +1064,8 @@ def Inner():
1065
1064
1066
1065
1067
1066
async def test_neighboring_contexts_do_not_conflict ():
1068
- LeftContext = idom .create_context (None , name = "Left" )
1069
- RightContext = idom .create_context (None , name = "Right" )
1067
+ LeftContext = idom .create_context (None )
1068
+ RightContext = idom .create_context (None )
1070
1069
1071
1070
set_left = idom .Ref ()
1072
1071
set_right = idom .Ref ()
@@ -1249,7 +1248,7 @@ def SomeComponent():
1249
1248
async def test_conditionally_rendered_components_can_use_context ():
1250
1249
set_state = idom .Ref ()
1251
1250
used_context_values = []
1252
- some_context = idom .create_context ("some_context" , None )
1251
+ some_context = idom .create_context (None )
1253
1252
1254
1253
@idom .component
1255
1254
def SomeComponent ():
You can’t perform that action at this time.
0 commit comments