Fixed all ruff issues
This commit is contained in:
@@ -85,7 +85,7 @@ class TestImdbIdEdgeCases:
|
||||
id2 = ImdbId("tt1234567")
|
||||
|
||||
# Should be usable in set
|
||||
s = {id1, id2}
|
||||
_s = {id1, id2} # Test hashability
|
||||
# Depending on implementation, might be 1 or 2 items
|
||||
|
||||
|
||||
|
||||
@@ -390,9 +390,8 @@ class TestMemoryEdgeCases:
|
||||
"""Should create directory if not exists."""
|
||||
new_dir = temp_dir / "new" / "nested" / "dir"
|
||||
|
||||
# Create parent directories first
|
||||
new_dir.mkdir(parents=True, exist_ok=True)
|
||||
memory = Memory(storage_dir=str(new_dir))
|
||||
# Don't create the directory - let Memory do it
|
||||
Memory(storage_dir=str(new_dir))
|
||||
|
||||
assert new_dir.exists()
|
||||
|
||||
@@ -405,7 +404,7 @@ class TestMemoryEdgeCases:
|
||||
try:
|
||||
os.chmod(readonly_dir, 0o444)
|
||||
# This might raise or might work depending on OS
|
||||
memory = Memory(storage_dir=str(readonly_dir))
|
||||
Memory(storage_dir=str(readonly_dir))
|
||||
except (PermissionError, OSError):
|
||||
pass # Expected on some systems
|
||||
finally:
|
||||
@@ -512,7 +511,7 @@ class TestMemoryContextEdgeCases:
|
||||
"""Should handle multiple init calls."""
|
||||
_memory_ctx.set(None)
|
||||
|
||||
mem1 = init_memory(str(temp_dir))
|
||||
init_memory(str(temp_dir))
|
||||
mem2 = init_memory(str(temp_dir))
|
||||
|
||||
# Second call should replace first
|
||||
|
||||
@@ -178,7 +178,7 @@ class TestPromptBuilderStructure:
|
||||
description = builder._format_tools_description()
|
||||
|
||||
# Should have tool names and descriptions
|
||||
for tool_name, tool in tools.items():
|
||||
for tool_name, _tool in tools.items():
|
||||
assert tool_name in description
|
||||
# Should have parameters info
|
||||
assert "Parameters" in description or "parameters" in description
|
||||
|
||||
@@ -71,7 +71,7 @@ class TestToolSpecFormat:
|
||||
|
||||
# Verify function has valid signature
|
||||
try:
|
||||
sig = inspect.signature(tool.func)
|
||||
inspect.signature(tool.func)
|
||||
# If we get here, signature is valid
|
||||
except Exception as e:
|
||||
pytest.fail(f"Tool {name} has invalid signature: {e}")
|
||||
|
||||
@@ -245,7 +245,7 @@ class TestMakeToolsEdgeCases:
|
||||
|
||||
for tool in tools.values():
|
||||
if "properties" in tool.parameters:
|
||||
for prop_name, prop_schema in tool.parameters["properties"].items():
|
||||
for _prop_name, prop_schema in tool.parameters["properties"].items():
|
||||
if "enum" in prop_schema:
|
||||
assert isinstance(prop_schema["enum"], list)
|
||||
assert len(prop_schema["enum"]) > 0
|
||||
|
||||
Reference in New Issue
Block a user