Skip to content

Commit b9ff0d8

Browse files
committed
update test and revert
1 parent 2075e62 commit b9ff0d8

File tree

2 files changed

+8
-23
lines changed

2 files changed

+8
-23
lines changed

eval_protocol/cli_commands/upload.py

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -186,30 +186,14 @@ def pytest_collection_modifyitems(self, items):
186186
]
187187

188188
try:
189-
# Run pytest collection with output captured so we can surface errors in CI
189+
# Suppress pytest output
190190
import io
191191
import contextlib
192192

193-
stdout = io.StringIO()
194-
stderr = io.StringIO()
195-
with contextlib.redirect_stdout(stdout), contextlib.redirect_stderr(stderr):
196-
exit_code = pytest.main(args, plugins=[plugin])
197-
198-
if exit_code != 0:
199-
# In CI this helps diagnose why discovery returned an empty list
200-
sys.stderr.write(f"[ep upload] pytest collection failed with exit code {exit_code} for root {abs_root}\n")
201-
out = stdout.getvalue()
202-
err = stderr.getvalue()
203-
if out:
204-
sys.stderr.write("[ep upload] pytest collection stdout:\n")
205-
sys.stderr.write(out + "\n")
206-
if err:
207-
sys.stderr.write("[ep upload] pytest collection stderr:\n")
208-
sys.stderr.write(err + "\n")
209-
return []
210-
except Exception as e:
211-
# Log the exception instead of silently swallowing it
212-
sys.stderr.write(f"[ep upload] pytest collection raised an exception for root {abs_root}: {e!r}\n")
193+
with contextlib.redirect_stdout(io.StringIO()), contextlib.redirect_stderr(io.StringIO()):
194+
pytest.main(args, plugins=[plugin])
195+
except Exception:
196+
# If pytest collection fails, fall back to empty list
213197
return []
214198

215199
# Process collected items

tests/test_ep_upload_e2e.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ async def test_quickstart_eval(row: EvaluationRow) -> EvaluationRow:
410410

411411
test_project_dir, test_file_path = create_test_project_with_evaluation_test(
412412
test_content,
413-
"quickstart.py", # Non test_* filename
413+
"ep_upload_non_test_prefixed_eval.py", # Non test_* filename
414414
)
415415

416416
original_cwd = os.getcwd()
@@ -423,7 +423,8 @@ async def test_quickstart_eval(row: EvaluationRow) -> EvaluationRow:
423423

424424
assert len(discovered_tests) == 1
425425
assert "test_quickstart_eval" in discovered_tests[0].qualname
426-
assert "quickstart.py" in discovered_tests[0].file_path
426+
# Verify we discovered a non-test-prefixed file (our unique filename)
427+
assert "ep_upload_non_test_prefixed_eval.py" in discovered_tests[0].file_path
427428

428429
finally:
429430
os.chdir(original_cwd)

0 commit comments

Comments
 (0)