@@ -250,21 +250,21 @@ async def test_roles(bot: Client, guild: Guild) -> None:
250250
251251 try :
252252 with suppress (interactions .errors .Forbidden ):
253- roles .extend (
254- (
255- await guild .create_role ("_test_role3" ),
256- await guild .create_role ("_test_role1" , icon = "💥" ),
257- await guild .create_role ("_test_role2" , icon = r"tests/LordOfPolls.png" ),
258- )
259- )
260- assert roles [0 ].icon is None
253+ roles .append (await guild .create_role ("_test_role3" ))
254+ # will fail if the test server has not enabled the feature
255+ roles .append (await guild .create_role ("_test_role1" , icon = "💥" ))
256+ roles .append (await guild .create_role ("_test_role2" , icon = r"tests/LordOfPolls.png" ))
257+
258+ assert roles [0 ].icon is None
259+ with suppress (IndexError ):
261260 assert isinstance (roles [1 ].icon , PartialEmoji )
262261 assert isinstance (roles [2 ].icon , Asset )
263- await guild .me .add_role (roles [0 ])
264262 await guild .me .remove_role (roles [0 ])
265263
266264 await roles [0 ].edit (name = "_test_renamed" , color = BrandColors .RED )
267265
266+ assert roles [0 ].name == "_test_renamed"
267+
268268 for role in roles :
269269 await role .delete ()
270270
@@ -422,10 +422,10 @@ async def test_components(bot: Client, channel: GuildText) -> None:
422422 )
423423 await thread .send (
424424 "Test - StringSelectMenu" ,
425- components = StringSelectMenu ([ StringSelectOption (label = "test" , value = "test" )] ),
425+ components = StringSelectMenu (StringSelectOption (label = "test" , value = "test" )),
426426 )
427427
428- Modal ("Test Modal" , [ ParagraphText (label = "test" , value = "test value, press send" )] )
428+ Modal (ParagraphText (label = "test" , value = "test value, press send" ), title = "Test Modal" )
429429
430430 finally :
431431 with suppress (interactions .errors .NotFound ):
@@ -470,7 +470,7 @@ async def test_voice(bot: Client, guild: Guild) -> None:
470470
471471 audio = AudioVolume ("tests/test_audio.mp3" )
472472 vc .play_no_wait (audio )
473- await asyncio .sleep (2 )
473+ await asyncio .sleep (5 )
474474
475475 assert len (vc .current_audio .buffer ) != 0
476476 assert vc .player ._sent_payloads != 0
0 commit comments