Instructions to use EzioDevio/gemma4-dev-agent with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use EzioDevio/gemma4-dev-agent with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("EzioDevio/gemma4-dev-agent", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download tests/test_executor.py from EzioDevio/gemma4-dev-agent: direct link, hf CLI and curl.
- Browser
- Download file 1.54 kB
-
https://huggingface.co/EzioDevio/gemma4-dev-agent/resolve/main/tests/test_executor.py
- Command line
-
hf download hf://EzioDevio/gemma4-dev-agent/tests/test_executor.py
-
curl -L -o test_executor.py https://huggingface.co/EzioDevio/gemma4-dev-agent/resolve/main/tests/test_executor.py
1.54 kB
| import pytest | |
| from pathlib import Path | |
| from src.tools.executor import TestExecutor | |
| def test_executor_nonexistent_target(tmp_path): | |
| executor = TestExecutor(repo_root=str(tmp_path)) | |
| res = executor.run_pytest(test_path="nonexistent_test.py") | |
| assert res["status"] == "error" | |
| assert "does not exist" in res["message"] | |
| def test_executor_run_valid_suite(tmp_path): | |
| # Create a dummy valid test file | |
| dummy_test = tmp_path / "test_dummy.py" | |
| dummy_test.write_text("def test_pass(): assert True\n", encoding="utf-8") | |
| executor = TestExecutor(repo_root=str(tmp_path)) | |
| res = executor.run_pytest(test_path="test_dummy.py", extra_args=["-v"]) | |
| assert res["status"] == "passed" | |
| assert res["exit_code"] == 0 | |
| def test_executor_timeout_mock(monkeypatch, tmp_path): | |
| executor = TestExecutor(repo_root=str(tmp_path)) | |
| import subprocess | |
| def mock_run(*args, **kwargs): | |
| raise subprocess.TimeoutExpired(cmd="pytest", timeout=60) | |
| monkeypatch.setattr(subprocess, "run", mock_run) | |
| res = executor.run_pytest() | |
| assert res["status"] == "error" | |
| assert "timed out" in res["message"] | |
| def test_executor_exception_mock(monkeypatch, tmp_path): | |
| executor = TestExecutor(repo_root=str(tmp_path)) | |
| import subprocess | |
| def mock_run(*args, **kwargs): | |
| raise RuntimeError("Unexpected failure") | |
| monkeypatch.setattr(subprocess, "run", mock_run) | |
| res = executor.run_pytest() | |
| assert res["status"] == "error" | |
| assert "Unexpected failure" in res["message"] | |