[CI][RFC] Replace black-jupyter with ruff-format (#37210)

Co-authored-by: Alison Shao <a.shao@wustl.edu>
This commit is contained in:
Alex Nails
2026-09-02 19:46:08 -07:00
committed by GitHub
co-authored by Alison Shao
parent 2641e427be
commit 28262c20df
1411 changed files with 7766 additions and 8176 deletions
@@ -250,12 +250,12 @@ class TestCacheReport(CustomTestCase):
)
# Verify cache hit for same salt
assert (
cached_tokens_1_second > cached_tokens_1_first
), "Should have cache hit with same cache_salt"
assert (
cached_tokens_1_second == prompt_tokens_1 - 1
), "Should cache all prompt tokens except the last one"
assert cached_tokens_1_second > cached_tokens_1_first, (
"Should have cache hit with same cache_salt"
)
assert cached_tokens_1_second == prompt_tokens_1 - 1, (
"Should cache all prompt tokens except the last one"
)
# Third request with different cache_salt "salt2" - should not get cache hit
response3 = self.client.chat.completions.create(
@@ -269,9 +269,9 @@ class TestCacheReport(CustomTestCase):
print(f"First request with salt2 - cached_tokens: {cached_tokens_2_first}")
# Verify no cache hit for different salt (should be similar to first request with salt1)
assert (
cached_tokens_2_first <= cached_tokens_1_first + self.min_cached
), "Different cache_salt should not share cache"
assert cached_tokens_2_first <= cached_tokens_1_first + self.min_cached, (
"Different cache_salt should not share cache"
)
# Fourth request with same cache_salt "salt2" - should now get cache hit
response4 = self.client.chat.completions.create(
@@ -285,9 +285,9 @@ class TestCacheReport(CustomTestCase):
print(f"Second request with salt2 - cached_tokens: {cached_tokens_2_second}")
# Verify cache hit for salt2
assert (
cached_tokens_2_second > cached_tokens_2_first
), "Should have cache hit with same cache_salt for salt2"
assert cached_tokens_2_second > cached_tokens_2_first, (
"Should have cache hit with same cache_salt for salt2"
)
if __name__ == "__main__":
@@ -23,7 +23,6 @@ from sglang.test.test_utils import (
class TestToolChoiceLlama32(CustomTestCase):
@classmethod
def setUpClass(cls):
# Mark flaky tests for this model
@@ -379,15 +378,15 @@ class TestToolChoiceLlama32(CustomTestCase):
# Update function name if present (first chunk)
if tool_call_delta.function and tool_call_delta.function.name:
tool_calls_by_index[tool_index]["function"][
"name"
] = tool_call_delta.function.name
tool_calls_by_index[tool_index]["function"]["name"] = (
tool_call_delta.function.name
)
# Accumulate arguments (all chunks)
if tool_call_delta.function and tool_call_delta.function.arguments:
tool_calls_by_index[tool_index]["function"][
"arguments"
] += tool_call_delta.function.arguments
tool_calls_by_index[tool_index]["function"]["arguments"] += (
tool_call_delta.function.arguments
)
self.assertGreater(len(tool_calls_by_index), 0)