Skip to content

Commit 14c2d45

Browse files
committed
server : make scopr of test parameters local
1 parent 0876d42 commit 14c2d45

File tree

11 files changed

+11
-13
lines changed

11 files changed

+11
-13
lines changed

tools/server/tests/unit/test_basic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
server = ServerPreset.tinyllama2()
66

77

8-
@pytest.fixture(scope="module", autouse=True)
8+
@pytest.fixture(autouse=True)
99
def create_server():
1010
global server
1111
server = ServerPreset.tinyllama2()

tools/server/tests/unit/test_completion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
server = ServerPreset.tinyllama2()
88

99

10-
@pytest.fixture(scope="module", autouse=True)
10+
@pytest.fixture(autouse=True)
1111
def create_server():
1212
global server
1313
server = ServerPreset.tinyllama2()

tools/server/tests/unit/test_ctx_shift.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
1212
""".strip()
1313

14-
@pytest.fixture(scope="module", autouse=True)
14+
@pytest.fixture(autouse=True)
1515
def create_server():
1616
global server
1717
server = ServerPreset.tinyllama2()
@@ -27,7 +27,6 @@ def test_ctx_shift_enabled():
2727
global server
2828
server.enable_ctx_shift = True
2929
server.start()
30-
server.enable_ctx_shift = False
3130
res = server.make_request("POST", "/completion", data={
3231
"n_predict": 64,
3332
"prompt": LONG_TEXT,

tools/server/tests/unit/test_embedding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
EPSILON = 1e-3
1010

11-
@pytest.fixture(scope="module", autouse=True)
11+
@pytest.fixture(autouse=True)
1212
def create_server():
1313
global server
1414
server = ServerPreset.bert_bge_small()

tools/server/tests/unit/test_infill.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
server = ServerPreset.tinyllama_infill()
55

6-
@pytest.fixture(scope="module", autouse=True)
6+
@pytest.fixture(autouse=True)
77
def create_server():
88
global server
99
server = ServerPreset.tinyllama_infill()

tools/server/tests/unit/test_lora.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
LORA_FILE_URL = "https://huggingface.co/ggml-org/stories15M_MOE/resolve/main/moe_shakespeare15M.gguf"
77

8-
@pytest.fixture(scope="module", autouse=True)
8+
@pytest.fixture(autouse=True)
99
def create_server():
1010
global server
1111
server = ServerPreset.stories15m_moe()

tools/server/tests/unit/test_rerank.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
server = ServerPreset.jina_reranker_tiny()
55

66

7-
@pytest.fixture(scope="module", autouse=True)
7+
@pytest.fixture(autouse=True)
88
def create_server():
99
global server
1010
server = ServerPreset.jina_reranker_tiny()

tools/server/tests/unit/test_security.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
TEST_API_KEY = "sk-this-is-the-secret-key"
88

9-
@pytest.fixture(scope="module", autouse=True)
9+
@pytest.fixture(autouse=True)
1010
def create_server():
1111
global server
1212
server = ServerPreset.tinyllama2()

tools/server/tests/unit/test_slot_save.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
server = ServerPreset.tinyllama2()
55

6-
@pytest.fixture(scope="module", autouse=True)
6+
@pytest.fixture(autouse=True)
77
def create_server():
88
global server
99
server = ServerPreset.tinyllama2()

tools/server/tests/unit/test_speculative.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def create_server():
1616
server.draft_max = 8
1717

1818

19-
@pytest.fixture(scope="module", autouse=True)
19+
@pytest.fixture(autouse=True)
2020
def fixture_create_server():
2121
return create_server()
2222

@@ -93,7 +93,6 @@ def test_with_ctx_shift():
9393
server.n_ctx = 64
9494
server.enable_ctx_shift = True
9595
server.start()
96-
server.enable_ctx_shift = False
9796
res = server.make_request("POST", "/completion", data={
9897
"prompt": "Hello " * 56,
9998
"temperature": 0.0,

0 commit comments

Comments
 (0)