Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions benchmarks/swebenchmultimodal/eval_infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ def convert_to_swebench_format(
f"{error_count} errors"
)

if converted_count == 0:
raise ValueError("No valid entries were converted")


def run_swebench_multimodal_evaluation(
predictions_file: str,
Expand Down
30 changes: 30 additions & 0 deletions tests/test_swebenchmultimodal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""Tests for SWE-Bench Multimodal eval_infer functionality."""

import tempfile

from benchmarks.swebenchmultimodal.eval_infer import convert_to_swebench_format


class TestConvertToSwebenchFormat:
"""Tests for convert_to_swebench_format function."""

def test_empty_input_file_does_not_raise(self):
"""Test that an empty input file does not raise an exception."""
with tempfile.NamedTemporaryFile(
mode="w", suffix=".jsonl", delete=False
) as infile:
infile.write("") # Empty file
input_path = infile.name

with tempfile.NamedTemporaryFile(
mode="w", suffix=".swebench.jsonl", delete=False
) as outfile:
output_path = outfile.name

# Should not raise - let the harness handle empty results
convert_to_swebench_format(input_path, output_path)

# Verify output file is empty
with open(output_path, "r") as f:
lines = f.readlines()
assert len(lines) == 0