Skip to content

Commit 86b9d70

Browse files
committed
test: Fix failing unit test by skipping based on cdi version
1 parent 84b523a commit 86b9d70

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/supertokens_python/test_supertokens_functions.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@
1414

1515
from typing import List
1616

17-
from pytest import mark
17+
from pytest import mark, skip
1818
from tests.utils import clean_st, reset, setup_st, start_st
1919

2020
from supertokens_python import InputAppInfo, SupertokensConfig
2121
from supertokens_python import asyncio as st_asyncio
2222
from supertokens_python import init
23+
from supertokens_python.querier import Querier
2324
from supertokens_python.recipe import emailpassword, session
2425
from supertokens_python.recipe.emailpassword import asyncio as ep_asyncio
2526
from supertokens_python.recipe.emailpassword.interfaces import SignUpOkResult
27+
from supertokens_python.utils import is_version_gte
2628

2729

2830
def setup_function(_):
@@ -71,6 +73,11 @@ async def test_supertokens_functions():
7173
emails_desc = [user.email for user in users_desc]
7274
assert emails_desc == emails[::-1]
7375

76+
version = await Querier.get_instance().get_api_version()
77+
if not is_version_gte(version, "2.10"):
78+
# If the version less than 2.10, delete user feature didn't exist, so skip the test
79+
skip()
80+
7481
# Delete the 2nd user (bar@example.com)
7582
await st_asyncio.delete_user(user_ids[1])
7683

0 commit comments

Comments
 (0)