File tree Expand file tree Collapse file tree 2 files changed +8
-22
lines changed Expand file tree Collapse file tree 2 files changed +8
-22
lines changed Original file line number Diff line number Diff line change @@ -516,19 +516,12 @@ async def test_update_empty_field(async_client):
516516 await Tags ._index .delete (ignore_unavailable = True )
517517 await Tags .init ()
518518 d = Tags (id = "123" , tags = ["a" , "b" ])
519- await d .save (wait_for_active_shards = 1 )
520- await d .update (tags = [])
519+ await d .save (refresh = True )
520+ await d .update (tags = [], refresh = True )
521521 assert d .tags == []
522522
523- while True :
524- try :
525- r = await Tags .search ().execute ()
526- d = r .hits [0 ]
527- except IndexError :
528- continue
529- else :
530- break
531- assert d .tags == []
523+ r = await Tags .search ().execute ()
524+ assert r .hits [0 ].tags == []
532525
533526
534527@pytest .mark .asyncio
Original file line number Diff line number Diff line change @@ -510,19 +510,12 @@ def test_update_empty_field(client):
510510 Tags ._index .delete (ignore_unavailable = True )
511511 Tags .init ()
512512 d = Tags (id = "123" , tags = ["a" , "b" ])
513- d .save (wait_for_active_shards = 1 )
514- d .update (tags = [])
513+ d .save (refresh = True )
514+ d .update (tags = [], refresh = True )
515515 assert d .tags == []
516516
517- while True :
518- try :
519- r = Tags .search ().execute ()
520- d = r .hits [0 ]
521- except IndexError :
522- continue
523- else :
524- break
525- assert d .tags == []
517+ r = Tags .search ().execute ()
518+ assert r .hits [0 ].tags == []
526519
527520
528521@pytest .mark .sync
You can’t perform that action at this time.
0 commit comments