Skip to content

Commit fb1cdb8

Browse files
committed
3.13 test
1 parent f5f15e6 commit fb1cdb8

File tree

2 files changed

+12
-19
lines changed

2 files changed

+12
-19
lines changed

.github/workflows/python.yaml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,9 @@ jobs:
8888
- { os: windows-latest, python-version: 3.10 }
8989
- { os: windows-latest, python-version: 3.11 }
9090
- { os: windows-latest, python-version: 3.12 }
91-
- { os: windows-latest, python-version: 3.9 }
92-
- { os: ubuntu-latest, python-version: 3.9 }
93-
- { os: ubuntu-latest, python-version: 3.10 }
94-
- { os: ubuntu-latest, python-version: 3.11 }
95-
- { os: ubuntu-latest, python-version: 3.12 }
96-
# include:
97-
# - { os: self-hosted, module: gpu, python-version: 3.9}
98-
# - { os: macos-latest, module: metal, python-version: "3.10" }
91+
include:
92+
- { os: self-hosted, module: gpu, python-version: 3.9}
93+
- { os: macos-latest, module: metal, python-version: "3.10" }
9994

10095
steps:
10196
- name: Check out code

xinference/model/embedding/tests/test_embedding_models.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ def test_register_fault_embedding():
264264
with open(file_path, "w") as f:
265265
json.dump(data, f, indent=4)
266266

267-
# Debug: Verify file was created
267+
# Debug: Verify file was created
268268
print(f"DEBUG: File exists after writing: {os.path.exists(file_path)}")
269269
if os.path.exists(file_path):
270270
with open(file_path, "r") as f:
@@ -302,8 +302,10 @@ def custom_warning_handler(
302302
# Restore original warning handler
303303
warnings.showwarning = old_showwarning
304304

305-
# Now run with pytest.warns to capture the official warningswith pytest.warns(UserWarning) as record:
305+
# Now run with pytest.warns to capture the official warnings
306+
with pytest.warns(UserWarning) as record:
306307
_install()
308+
307309
print(f"DEBUG: pytest.warns captured {len(record)} warnings")
308310
for i, warning in enumerate(record):
309311
print(f"DEBUG: pytest warning {i+1}: {warning.message}")
@@ -317,8 +319,8 @@ def custom_warning_handler(
317319
print(f"DEBUG: Checking warning message: {message}")
318320
if (
319321
"has error" in message
320-
and(
321-
"Invalid model URI " in message
322+
and (
323+
"Invalid model URI" in message
322324
or "Model URI cannot be a relative path" in message
323325
)
324326
and "/new_data/cache/gte-Qwen2" in message
@@ -329,9 +331,9 @@ def custom_warning_handler(
329331

330332
assert (
331333
found_warning
332-
), f"Expected warning about invalid model URI not found. Warnings: {[str(w.message)
333-
for w in record]}"
334-
finally:
334+
), f"Expected warning about invalid model URI not found. Warnings: {[str(w.message) for w in record]}"
335+
336+
finally:
335337
# Restore original warning handler
336338
warnings.showwarning = old_showwarning
337339

@@ -342,10 +344,6 @@ def custom_warning_handler(
342344
if os.path.exists(file_path):
343345
os.remove(file_path)
344346
print("DEBUG: Test file cleaned up")
345-
finally:
346-
# Clean up the test file to avoid interference with subsequent test runs
347-
if os.path.exists(file_path):
348-
os.remove(file_path)
349347

350348

351349
def test_convert_ids_to_tokens():

0 commit comments

Comments
 (0)