99import mock
1010import pytest
1111import pytest_asyncio
12- import pytest_ordering as pytest
1312from discord .ext import commands
1413from sqlalchemy import select , and_
1514
@@ -68,7 +67,8 @@ async def test_twitch_is_enabled_false(twitch_cog: cog.TwitchAlert):
6867
6968
7069# @mock.patch("koala.utils.random_id", mock.MagicMock(return_value=7357))
71- @pytest .mark .asyncio (order = 1 )
70+ @pytest .mark .order (1 )
71+ @pytest .mark .asyncio
7272async def test_edit_default_message_default_from_none (twitch_cog ):
7373 this_channel = dpytest .get_config ().channels [0 ]
7474 assert_embed = discord .Embed (title = "Default Message Edited" ,
@@ -81,7 +81,8 @@ async def test_edit_default_message_default_from_none(twitch_cog):
8181
8282
8383# @mock.patch("koala.utils.random_id", mock.MagicMock(return_value=7357))
84- @pytest .mark .asyncio (order = 2 )
84+ @pytest .mark .order (2 )
85+ @pytest .mark .asyncio
8586async def test_edit_default_message_existing (twitch_cog ):
8687 this_channel = dpytest .get_config ().channels [0 ]
8788 assert_embed = discord .Embed (title = "Default Message Edited" ,
@@ -92,8 +93,8 @@ async def test_edit_default_message_existing(twitch_cog):
9293 await dpytest .message (koalabot .COMMAND_PREFIX + "twitch editMsg " + str (this_channel .id ) + " {user} is bad" )
9394 assert dpytest .verify ().message ().embed (embed = assert_embed )
9495
95-
96- @pytest .mark .asyncio ( order = 3 )
96+ @ pytest . mark . order ( 3 )
97+ @pytest .mark .asyncio
9798async def test_add_user_to_twitch_alert (twitch_cog ):
9899 assert_embed = discord .Embed (title = "Added User to Twitch Alert" ,
99100 description = f"Channel: { dpytest .get_config ().channels [0 ].id } \n "
@@ -105,8 +106,8 @@ async def test_add_user_to_twitch_alert(twitch_cog):
105106 f"{ koalabot .COMMAND_PREFIX } twitch add monstercat { dpytest .get_config ().channels [0 ].id } " )
106107 assert dpytest .verify ().message ().embed (embed = assert_embed )
107108
108-
109- @pytest .mark .asyncio ( order = 3 )
109+ @ pytest . mark . order ( 3 )
110+ @pytest .mark .asyncio
110111async def test_add_user_to_twitch_alert_wrong_guild (twitch_cog : twitch_alert .cog .TwitchAlert ):
111112 guild = dpytest .backend .make_guild (name = "TestGuild" )
112113 channel = dpytest .backend .make_text_channel (name = "TestChannel" , guild = guild )
@@ -121,8 +122,8 @@ async def test_add_user_to_twitch_alert_wrong_guild(twitch_cog: twitch_alert.cog
121122 f"{ koalabot .COMMAND_PREFIX } twitch add monstercat { dpytest .get_config ().guilds [0 ].channels [0 ].id } " ,
122123 channel = - 1 , member = member )
123124
124-
125- @pytest .mark .asyncio ( order = 3 )
125+ @ pytest . mark . order ( 3 )
126+ @pytest .mark .asyncio
126127async def test_add_user_to_twitch_alert_custom_message (twitch_cog : twitch_alert .cog .TwitchAlert ):
127128 test_custom_message = "We be live gamers!"
128129
@@ -184,8 +185,8 @@ async def test_remove_user_from_twitch_alert_with_message(twitch_cog: twitch_ale
184185 result_after = session .execute (sql_check_updated_server ).one_or_none ()
185186 assert result_after is None
186187
187-
188- @pytest .mark .asyncio ( order = 3 )
188+ @ pytest . mark . order ( 3 )
189+ @pytest .mark .asyncio
189190async def test_remove_user_from_twitch_alert_wrong_guild (twitch_cog ):
190191 guild = dpytest .backend .make_guild (name = "TestGuild" )
191192 channel = dpytest .backend .make_text_channel (name = "TestChannel" , guild = guild )
@@ -283,8 +284,8 @@ async def test_remove_team_from_twitch_alert_with_message(twitch_cog):
283284 assert dpytest .verify ().message ().embed (new_embed )
284285 pass
285286
286-
287- @pytest .mark .asyncio ( order = 3 )
287+ @ pytest . mark . order ( 3 )
288+ @pytest .mark .asyncio
288289async def test_remove_team_from_twitch_alert_wrong_guild (twitch_cog ):
289290 guild = dpytest .backend .make_guild (name = "TestGuild" )
290291 channel = dpytest .backend .make_text_channel (name = "TestChannel" , guild = guild )
0 commit comments