File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -49,13 +49,18 @@ def test_scope_flags_copy():
4949 old_scope .flags .set ("a" , True )
5050
5151 # Scope is forked; flag buffer is copied and contains the data of
52- # the parent. The flag is overwritten.
52+ # the parent. The flag is overwritten on the child. The parent
53+ # scope can continue mutating without interfering with the child.
5354 new_scope = old_scope .fork ()
5455 new_scope .flags .set ("a" , False )
56+ old_scope .flags .set ("b" , True )
5557
5658 # New scope has the change. Old scope was not polluted by changes
5759 # to the new scope.
58- old_scope .flags .get () == [{"flag" : "a" , "result" : True }]
60+ old_scope .flags .get () == [
61+ {"flag" : "a" , "result" : True },
62+ {"flag" : "b" , "result" : True },
63+ ]
5964 new_scope .flags .get () == [{"flag" : "a" , "result" : False }]
6065
6166
You can’t perform that action at this time.
0 commit comments