hermes - ✅(Solved) Fix Bug: tests/integration/test_web_tools.py is named like a pytest module but collects zero tests [2 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

tests/integration/test_web_tools.py is marked as an integration test module and named like a pytest file, but it defines no collectable pytest tests.

As a result, pytest runs nothing from this file, so web-tools integration coverage is effectively absent in the pytest workflow.

Root Cause

tests/integration/test_web_tools.py is marked as an integration test module and named like a pytest file, but it defines no collectable pytest tests.

As a result, pytest runs nothing from this file, so web-tools integration coverage is effectively absent in the pytest workflow.

Fix Action

Fixed

PR fix notes

PR #13318: fix(tests): make test_modal_terminal actually assert, not return booleans

Description (problem / solution / changelog)

Summary

Closes #13286.

Six of the tests in tests/integration/test_modal_terminal.py used:

success = <condition>
...
return success

Pytest treats a returned value as a warning, not a failure. Every one of these tests has been reported as PASSED regardless of whether Modal actually worked — the file was effectively a no-op under pytest, masking real Modal terminal regressions.

The fix

  • Replace return success / return isolated / return requirements_met with assert <value>, <diagnostic message>. The diagnostic includes exit code and error text so a CI failure is actionable, e.g.:

    assert success, f"Simple command failed: exit={result_json.get('exit_code')}, error={result_json.get('error')}"
  • Replace the TERMINAL_ENV != modal → return False in test_modal_requirements() with pytest.skip(...), which is the correct signal when a precondition isn't met. The test is no longer misreported as PASSED when Modal isn't configured — it's cleanly skipped.

  • Keep the imperative main() runner usable (for the python tests/integration/test_modal_terminal.py usage the module docstring advertises). Rewrote it to tolerate AssertionError / pytest.skip.Exception and classify each test as PASSED / FAILED / SKIPPED in the summary.

Diff

-    if config['env_type'] != 'modal':
-        print(...)
-        return False
+    if config['env_type'] != 'modal':
+        print(...)
+        pytest.skip(f"TERMINAL_ENV='{config['env_type']}', skipping Modal-specific test")
...
-    return success
+    assert success, f"Simple command failed: exit={result_json.get('exit_code')}, error={result_json.get('error')}"

One file changed, +52 / −29 lines.

Verification

  • python3 -m py_compile tests/integration/test_modal_terminal.py → clean.
  • Walked the file top to bottom, confirmed all six test bodies now end with an assert carrying a descriptive message, and that test_modal_requirements() uses pytest.skip() instead of return False when TERMINAL_ENV != "modal".
  • main() still works as a script runner: any pytest.skip.Exception or AssertionError raised by a test function is caught, classified, and reported in the summary — matching the previous script-style behavior as closely as possible while letting pytest do the right thing.

Not in scope

  • #13287 (test_web_tools.py collects 0 tests) — addressed by a different PR / decision about whether to rename or add pytest markers.
  • Reworking these tests into proper @pytest.mark.modal fixtures with conftest auto-skip — would be a larger refactor; this PR intentionally stays minimal and just makes the existing tests actually assert.

Linked Issue

  • Closes #13286

Changed files

  • tests/integration/test_modal_terminal.py (modified, +52/-29)

PR #13335: fix(tests): collect web tools integration checks

Description (problem / solution / changelog)

Fixes #13287.

Root cause: tests/integration/test_web_tools.py looked like a pytest integration module but only exposed a manual script-style harness, so pytest collected zero tests from the file.

Fix summary:

  • Add real pytest-collectable wrappers for search, extraction without LLM, extraction with LLM, and crawl flows.
  • Keep the manual script entry point intact.
  • Gate live web checks behind existing web backend credential detection so default local/CI runs skip safely instead of making unauthenticated external calls.
  • Add structure/content assertions for enabled integration runs.

Tests:

  • uv run --frozen --python 3.11 --extra dev pytest -o addopts= --collect-only tests/integration/test_web_tools.py -> 4 tests collected
  • uv run --frozen --python 3.11 --extra dev pytest -o addopts= tests/integration/test_web_tools.py -q -> 4 skipped
  • git diff --check -- tests/integration/test_web_tools.py

Changed files

  • tests/integration/test_web_tools.py (modified, +158/-0)

Code Example

cd /Users/genie/.hermes/hermes-agent
source venv/bin/activate
pytest -q -m integration -o addopts='' tests/integration/test_web_tools.py

---

no tests ran in 0.26s
RAW_BUFFERClick to expand / collapse

Summary

tests/integration/test_web_tools.py is marked as an integration test module and named like a pytest file, but it defines no collectable pytest tests.

As a result, pytest runs nothing from this file, so web-tools integration coverage is effectively absent in the pytest workflow.

Affected file

  • tests/integration/test_web_tools.py

Why this is a bug

The file looks like part of the test suite, but its checks only run through the manual main() script path. This creates a false sense of coverage.

Reproduction

cd /Users/genie/.hermes/hermes-agent
source venv/bin/activate
pytest -q -m integration -o addopts='' tests/integration/test_web_tools.py

Observed output:

no tests ran in 0.26s

The file is pytest-marked at the top:

  • tests/integration/test_web_tools.py:18-19

But it contains helper classes/methods and a script-style runner rather than collectable test_* functions/classes.

Expected behavior

If this file lives under tests/integration/test_*.py, pytest should collect and execute real tests from it.

Actual behavior

Pytest collects nothing from the module.

Suggested investigation direction

Either convert the script into real pytest tests, or move/rename it so it no longer appears to be part of the active pytest suite.

extent analysis

TL;DR

The issue can be resolved by converting the script in tests/integration/test_web_tools.py into collectable pytest tests or renaming/moving the file to exclude it from the pytest suite.

Guidance

  • Verify that the file tests/integration/test_web_tools.py contains no collectable pytest tests by checking for functions or classes named with the test_ prefix.
  • Convert the script-style runner in test_web_tools.py into pytest tests by defining functions with the test_ prefix that contain the necessary assertions.
  • Consider renaming or moving the file to a location that is not included in the pytest suite if it is not intended to contain collectable tests.
  • Use the provided reproduction steps to verify that the changes resolve the issue and allow pytest to collect and execute tests from the file.

Example

# Before
def main():
    # script-style runner code

# After
def test_web_tools():
    # test code with assertions
    assert True

Notes

The solution requires modifying the existing code in tests/integration/test_web_tools.py to conform to pytest's test collection rules. The exact changes will depend on the specific content and purpose of the file.

Recommendation

Apply workaround: Convert the script into real pytest tests. This approach ensures that the tests are properly collected and executed by pytest, providing accurate coverage information.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

If this file lives under tests/integration/test_*.py, pytest should collect and execute real tests from it.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - ✅(Solved) Fix Bug: tests/integration/test_web_tools.py is named like a pytest module but collects zero tests [2 pull requests]