Fix(test): downgrade test priorities (#12913)

### What problem does this PR solve?

Changed test priorities in multiple test files, downgrading from p1 to
p2 and p2 to p3.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Liu An
2026-01-30 20:02:56 +08:00
committed by GitHub
parent eb75b1ce82
commit c4f60b349d
60 changed files with 108 additions and 104 deletions

View File

@ -81,7 +81,7 @@ class TestChatAssistantCreate:
chat_assistant = client.create_chat(name="avatar_test", avatar=encode_avatar(fn), dataset_ids=[])
assert chat_assistant.name == "avatar_test"
@pytest.mark.p2
@pytest.mark.p3
@pytest.mark.parametrize(
"llm, expected_message",
[
@ -137,7 +137,7 @@ class TestChatAssistantCreate:
assert attrgetter("frequency_penalty")(chat_assistant.llm) == 0.7
assert attrgetter("max_tokens")(chat_assistant.llm) == 512
@pytest.mark.p2
@pytest.mark.p3
@pytest.mark.parametrize(
"prompt, expected_message",
[

View File

@ -27,7 +27,7 @@ from utils.hypothesis_utils import valid_names
@pytest.mark.usefixtures("clear_datasets")
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_message",
[
@ -117,7 +117,7 @@ class TestDatasetCreate:
}
client.create_dataset(**payload)
@pytest.mark.p2
@pytest.mark.p3
def test_avatar_exceeds_limit_length(self, client):
payload = {"name": "avatar_exceeds_limit_length", "avatar": "a" * 65536}
with pytest.raises(Exception) as exception_info:
@ -157,7 +157,7 @@ class TestDatasetCreate:
dataset = client.create_dataset(**payload)
assert dataset.description == "description", str(dataset)
@pytest.mark.p2
@pytest.mark.p3
def test_description_exceeds_limit_length(self, client):
payload = {"name": "description_exceeds_limit_length", "description": "a" * 65536}
with pytest.raises(Exception) as exception_info:
@ -245,7 +245,7 @@ class TestDatasetCreate:
dataset = client.create_dataset(**payload)
assert dataset.embedding_model == "BAAI/bge-small-en-v1.5@Builtin", str(dataset)
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"name, permission",
[

View File

@ -23,7 +23,7 @@ from ragflow_sdk import RAGFlow
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_message",
[
@ -79,7 +79,7 @@ class TestDatasetsDelete:
datasets = client.list_datasets()
assert len(datasets) == remaining, str(datasets)
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.usefixtures("add_dataset_func")
def test_ids_empty(self, client):
payload = {"ids": []}
@ -88,7 +88,7 @@ class TestDatasetsDelete:
datasets = client.list_datasets()
assert len(datasets) == 1, str(datasets)
@pytest.mark.p1
@pytest.mark.p3
@pytest.mark.usefixtures("add_datasets_func")
def test_ids_none(self, client):
payload = {"ids": None}
@ -167,7 +167,7 @@ class TestDatasetsDelete:
client.delete_datasets(**payload)
assert "lacks permission for dataset" in str(exception_info.value), str(exception_info.value)
@pytest.mark.p2
@pytest.mark.p3
@pytest.mark.usefixtures("add_dataset_func")
def test_field_unsupported(self, client):
payload = {"unknown_field": "unknown_field"}

View File

@ -22,7 +22,7 @@ from ragflow_sdk import RAGFlow
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_message",
[
@ -54,7 +54,7 @@ class TestCapability:
@pytest.mark.usefixtures("add_datasets")
class TestDatasetsList:
@pytest.mark.p1
@pytest.mark.p2
def test_params_unset(self, client):
datasets = client.list_datasets()
assert len(datasets) == 5, str(datasets)
@ -135,7 +135,7 @@ class TestDatasetsList:
client.list_datasets(**params)
assert "not instance of" in str(exception_info.value), str(exception_info.value)
@pytest.mark.p2
@pytest.mark.p3
@pytest.mark.parametrize(
"params",
[
@ -171,7 +171,7 @@ class TestDatasetsList:
client.list_datasets(**params)
assert "not instance of" in str(exception_info.value), str(exception_info.value)
@pytest.mark.p2
@pytest.mark.p3
@pytest.mark.parametrize(
"params",
[
@ -306,7 +306,7 @@ class TestDatasetsList:
client.list_datasets(**params)
assert "lacks permission for dataset" in str(exception_info.value), str(exception_info.value)
@pytest.mark.p2
@pytest.mark.p3
def test_field_unsupported(self, client):
params = {"unknown_field": "unknown_field"}
with pytest.raises(Exception) as exception_info:

View File

@ -105,7 +105,7 @@ class TestDatasetUpdate:
retrieved_dataset = client.get_dataset(name=dataset.name)
assert retrieved_dataset.avatar == avatar_data, str(retrieved_dataset)
@pytest.mark.p2
@pytest.mark.p3
def test_avatar_exceeds_limit_length(self, add_dataset_func):
dataset = add_dataset_func
with pytest.raises(Exception) as exception_info:
@ -148,7 +148,7 @@ class TestDatasetUpdate:
retrieved_dataset = client.get_dataset(name=dataset.name)
assert retrieved_dataset.description == "description", str(retrieved_dataset)
@pytest.mark.p2
@pytest.mark.p3
def test_description_exceeds_limit_length(self, add_dataset_func):
dataset = add_dataset_func
with pytest.raises(Exception) as exception_info:
@ -235,7 +235,7 @@ class TestDatasetUpdate:
retrieved_dataset = client.get_dataset(name=dataset.name)
assert retrieved_dataset.embedding_model == "BAAI/bge-small-en-v1.5@Builtin", str(retrieved_dataset)
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"permission",
[

View File

@ -63,7 +63,7 @@ class TestDocumentsUpload:
assert document.dataset_id == dataset.id, str(document)
assert document.name == fp.name, str(document)
@pytest.mark.p2
@pytest.mark.p3
@pytest.mark.parametrize(
"file_type",
["exe", "unknown"],

View File

@ -24,7 +24,7 @@ from utils.hypothesis_utils import valid_names
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_message",
[

View File

@ -20,7 +20,7 @@ from ragflow_sdk import RAGFlow
from configs import INVALID_API_TOKEN, HOST_ADDRESS
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_message",
[
@ -47,13 +47,13 @@ class TestCapability:
@pytest.mark.usefixtures("add_memory_func")
class TestMemoryList:
@pytest.mark.p1
@pytest.mark.p2
def test_params_unset(self, client):
res = client.list_memory()
assert len(res["memory_list"]) == 3, str(res)
assert res["total_count"] == 3, str(res)
@pytest.mark.p1
@pytest.mark.p2
def test_params_empty(self, client):
res = client.list_memory(**{})
assert len(res["memory_list"]) == 3, str(res)

View File

@ -18,7 +18,7 @@ from ragflow_sdk import RAGFlow
from configs import INVALID_API_TOKEN, HOST_ADDRESS
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_message",
[

View File

@ -24,7 +24,7 @@ from utils.hypothesis_utils import valid_names
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_message",
[
@ -84,7 +84,7 @@ class TestMemoryUpdate:
res_1 = memory_1.update(update_dict)
assert res_1.name == "Test_Memory(1)", str(res_1)
@pytest.mark.p1
@pytest.mark.p2
def test_avatar(self, client, tmp_path):
memory_ids = self.memory_ids
fn = create_image_file(tmp_path / "ragflow_test.png")
@ -93,7 +93,7 @@ class TestMemoryUpdate:
res = memory.update(update_dict)
assert res.avatar == f"data:image/png;base64,{encode_avatar(fn)}", str(res)
@pytest.mark.p1
@pytest.mark.p2
def test_description(self, client):
memory_ids = self.memory_ids
description = "This is a test description."
@ -111,7 +111,7 @@ class TestMemoryUpdate:
res = memory.update(update_dict)
assert res.llm_id == llm_id, str(res)
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"permission",
[

View File

@ -20,7 +20,7 @@ from ragflow_sdk import RAGFlow, Memory
from configs import INVALID_API_TOKEN, HOST_ADDRESS
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_message",
[

View File

@ -20,7 +20,7 @@ from configs import INVALID_API_TOKEN, HOST_ADDRESS
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_message",
[

View File

@ -20,7 +20,7 @@ from ragflow_sdk import RAGFlow, Memory
from configs import INVALID_API_TOKEN, HOST_ADDRESS
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_message",
[

View File

@ -21,7 +21,7 @@ from configs import INVALID_API_TOKEN, HOST_ADDRESS
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_message",
[

View File

@ -22,7 +22,7 @@ from configs import INVALID_API_TOKEN, HOST_ADDRESS
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_message",
[
@ -41,14 +41,14 @@ class TestAuthorization:
@pytest.mark.usefixtures("add_memory_with_5_raw_message_func")
class TestMessageList:
@pytest.mark.p1
@pytest.mark.p2
def test_params_unset(self, client):
memory_id = self.memory_id
memory = Memory(client, {"id": memory_id})
res = memory.list_memory_messages()
assert len(res["messages"]["message_list"]) == 5, str(res)
@pytest.mark.p1
@pytest.mark.p2
def test_params_empty(self, client):
memory_id = self.memory_id
memory = Memory(client, {"id": memory_id})

View File

@ -18,7 +18,7 @@ from ragflow_sdk import RAGFlow, Memory
from configs import INVALID_API_TOKEN, HOST_ADDRESS
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_message",
[

View File

@ -21,7 +21,7 @@ from configs import INVALID_API_TOKEN, HOST_ADDRESS
class TestAuthorization:
@pytest.mark.p1
@pytest.mark.p2
@pytest.mark.parametrize(
"invalid_auth, expected_message",
[