[MyPy][2/N] Fix mypy errors in small tests/ dirs (#51043)
Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com> Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Co-authored-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Harry Mellor
Claude Opus 5.5
parent
a96ee5935d
commit
5dd693122c
@@ -476,32 +476,32 @@ def test_compilation_config_mode_validator():
|
||||
"""Test that CompilationConfig.mode field validator converts strings to integers."""
|
||||
from vllm.config.compilation import CompilationConfig, CompilationMode
|
||||
|
||||
config = CompilationConfig(mode=0)
|
||||
config = CompilationConfig(mode=0) # type: ignore[arg-type]
|
||||
assert config.mode == CompilationMode.NONE
|
||||
|
||||
config = CompilationConfig(mode=3)
|
||||
config = CompilationConfig(mode=3) # type: ignore[arg-type]
|
||||
assert config.mode == CompilationMode.VLLM_COMPILE
|
||||
|
||||
config = CompilationConfig(mode="NONE")
|
||||
config = CompilationConfig(mode="NONE") # type: ignore[arg-type]
|
||||
assert config.mode == CompilationMode.NONE
|
||||
|
||||
config = CompilationConfig(mode="STOCK_TORCH_COMPILE")
|
||||
config = CompilationConfig(mode="STOCK_TORCH_COMPILE") # type: ignore[arg-type]
|
||||
assert config.mode == CompilationMode.STOCK_TORCH_COMPILE
|
||||
|
||||
config = CompilationConfig(mode="DYNAMO_TRACE_ONCE")
|
||||
config = CompilationConfig(mode="DYNAMO_TRACE_ONCE") # type: ignore[arg-type]
|
||||
assert config.mode == CompilationMode.DYNAMO_TRACE_ONCE
|
||||
|
||||
config = CompilationConfig(mode="VLLM_COMPILE")
|
||||
config = CompilationConfig(mode="VLLM_COMPILE") # type: ignore[arg-type]
|
||||
assert config.mode == CompilationMode.VLLM_COMPILE
|
||||
|
||||
config = CompilationConfig(mode="none")
|
||||
config = CompilationConfig(mode="none") # type: ignore[arg-type]
|
||||
assert config.mode == CompilationMode.NONE
|
||||
|
||||
config = CompilationConfig(mode="vllm_compile")
|
||||
config = CompilationConfig(mode="vllm_compile") # type: ignore[arg-type]
|
||||
assert config.mode == CompilationMode.VLLM_COMPILE
|
||||
|
||||
with pytest.raises(ValidationError, match="Invalid compilation mode"):
|
||||
CompilationConfig(mode="INVALID_MODE")
|
||||
CompilationConfig(mode="INVALID_MODE") # type: ignore[arg-type]
|
||||
|
||||
|
||||
def test_flat_product():
|
||||
|
||||
@@ -128,7 +128,7 @@ def test_lru_cache():
|
||||
|
||||
|
||||
def test_lru_cache_put_if_fits():
|
||||
cache = LRUCache(10, getsizeof=lambda x: x)
|
||||
cache = LRUCache[str, int](10, getsizeof=lambda x: x)
|
||||
|
||||
assert cache.put_if_fits("ok", 4) is True
|
||||
assert cache["ok"] == 4
|
||||
|
||||
@@ -206,8 +206,8 @@ def test_make_zmq_socket_ipv6():
|
||||
|
||||
|
||||
def test_make_zmq_path():
|
||||
assert make_zmq_path("tcp", "127.0.0.1", "5555") == "tcp://127.0.0.1:5555"
|
||||
assert make_zmq_path("tcp", "::1", "5555") == "tcp://[::1]:5555"
|
||||
assert make_zmq_path("tcp", "127.0.0.1", 5555) == "tcp://127.0.0.1:5555"
|
||||
assert make_zmq_path("tcp", "::1", 5555) == "tcp://[::1]:5555"
|
||||
|
||||
|
||||
def test_get_tcp_uri():
|
||||
|
||||
Reference in New Issue
Block a user