diff --git a/tests/conftest.py b/tests/conftest.py index af40730..014b5a9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -20,7 +20,9 @@ def group(pytestconfig): return {"id": load_variable("group_id", pytestconfig.cache), "type": ThreadType.GROUP} -@pytest.fixture(scope="session", params=["user", "group", pytest.mark.xfail("none")]) +@pytest.fixture(scope="session", params=[ + "user", "group", pytest.param("none", marks=[pytest.mark.xfail()]) +]) def thread(request, user, group): return { "user": user, diff --git a/tests/test_plans.py b/tests/test_plans.py index d16c153..9365d4a 100644 --- a/tests/test_plans.py +++ b/tests/test_plans.py @@ -11,8 +11,14 @@ from time import time @pytest.fixture(scope="module", params=[ Plan(int(time()) + 100, random_hex()), - pytest.mark.xfail(Plan(int(time()), random_hex()), raises=FBchatFacebookError), - pytest.mark.xfail(Plan(0, None)), + pytest.param( + Plan(int(time()), random_hex()), + marks=[pytest.mark.xfail(raises=FBchatFacebookError)] + ), + pytest.param( + Plan(0, None), + marks=[pytest.mark.xfail()], + ), ]) def plan_data(request, client, user, thread, catch_event, compare): with catch_event("onPlanCreated") as x: diff --git a/tests/test_polls.py b/tests/test_polls.py index 96dab76..96de743 100644 --- a/tests/test_polls.py +++ b/tests/test_polls.py @@ -26,7 +26,9 @@ from utils import random_hex, subset PollOption(random_hex()), PollOption(random_hex()), ]), - pytest.mark.xfail(Poll(title=None, options=[]), raises=ValueError), + pytest.param( + Poll(title=None, options=[]), marks=[pytest.mark.xfail(raises=ValueError)] + ), ]) def poll_data(request, client1, group, catch_event): with catch_event("onPollCreated") as x: diff --git a/tests/test_thread_interraction.py b/tests/test_thread_interraction.py index 16e7e9e..be5b0ff 100644 --- a/tests/test_thread_interraction.py +++ b/tests/test_thread_interraction.py @@ -72,8 +72,8 @@ def test_change_nickname(client, client_all, catch_event, compare): "😂", "😕", "😍", - pytest.mark.xfail("🙃", raises=FBchatFacebookError), - pytest.mark.xfail("not an emoji", raises=FBchatFacebookError) + pytest.param("🙃", marks=[pytest.mark.xfail(raises=FBchatFacebookError)]), + pytest.param("not an emoji", marks=[pytest.mark.xfail(raises=FBchatFacebookError)]), ]) def test_change_emoji(client, catch_event, compare, emoji): with catch_event("onEmojiChange") as x: @@ -101,7 +101,7 @@ def test_change_image_remote(client1, group, catch_event): [ x if x in [ThreadColor.MESSENGER_BLUE, ThreadColor.PUMPKIN] - else pytest.mark.expensive(x) + else pytest.param(x, marks=[pytest.mark.expensive()]) for x in ThreadColor ], ) diff --git a/tests/utils.py b/tests/utils.py index 51364cb..241a6ad 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -23,15 +23,15 @@ EMOJI_LIST = [ ("😆", EmojiSize.LARGE), # These fail in `catch_event` because the emoji is made into a sticker # This should be fixed - pytest.mark.xfail((None, EmojiSize.SMALL)), - pytest.mark.xfail((None, EmojiSize.MEDIUM)), - pytest.mark.xfail((None, EmojiSize.LARGE)), + pytest.param(None, EmojiSize.SMALL, marks=[pytest.mark.xfail()]), + pytest.param(None, EmojiSize.MEDIUM, marks=[pytest.mark.xfail()]), + pytest.param(None, EmojiSize.LARGE, marks=[pytest.mark.xfail()]), ] STICKER_LIST = [ Sticker("767334476626295"), - pytest.mark.xfail(Sticker("0"), raises=FBchatFacebookError), - pytest.mark.xfail(Sticker(None), raises=FBchatFacebookError), + pytest.param(Sticker("0"), marks=[pytest.mark.xfail(raises=FBchatFacebookError)]), + pytest.param(Sticker(None), marks=[pytest.mark.xfail(raises=FBchatFacebookError)]), ] TEXT_LIST = [ @@ -40,8 +40,8 @@ TEXT_LIST = [ "\\\n\t%?&'\"", "ˁҭʚ¹Ʋջوװ՞ޱɣࠚԹБɑȑңКએ֭ʗыԈٌʼőԈ×௴nચϚࠖణٔє܅Ԇޑط", "a" * 20000, # Maximum amount of characters you can send - pytest.mark.xfail("a" * 20001, raises=FBchatFacebookError), - pytest.mark.xfail(None, raises=FBchatFacebookError), + pytest.param("a" * 20001, marks=[pytest.mark.xfail(raises=FBchatFacebookError)]), + pytest.param(None, marks=[pytest.mark.xfail(raises=FBchatFacebookError)]), ]