Skip to content

Commit bb1c885

Browse files
author
Zvi Fried
committed
feat/general-refinement - test: demonstrate pre-commit blocking behavior with pytest
1 parent bf636a8 commit bb1c885

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

.pre-commit-config.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@ repos:
7777
- id: commitizen
7878
stages: [commit-msg]
7979

80+
# Run tests with pytest
81+
- repo: local
82+
hooks:
83+
- id: pytest
84+
name: pytest
85+
entry: pytest
86+
language: system
87+
types: [python]
88+
pass_filenames: false
89+
always_run: true
90+
args: ["-v", "--tb=short"]
91+
8092
- repo: https://github.com/pre-commit/mirrors-prettier
8193
rev: v4.0.0-alpha.8
8294
hooks:

tests/test_server.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
def test_server_initialization() -> None:
77
"""Test that the server can be initialized and tools are registered."""
88
# Check that the server instance exists
9-
assert mcp.name == "MCP as a Judge"
9+
assert mcp.name == "MCP-as-a-Judge"
1010

1111
# Check that the server has the expected attributes
1212
assert hasattr(mcp, "name")
@@ -18,12 +18,12 @@ def test_server_tools_registered() -> None:
1818
# when the server runs. We can't easily inspect them here, but we can
1919
# verify the server instance exists and has the expected structure.
2020
assert mcp is not None
21-
assert mcp.name == "MCP as a Judge"
21+
assert mcp.name == "MCP-as-a-Judge"
2222

2323

2424
def test_server_import() -> None:
2525
"""Test that the server can be imported without errors."""
2626
from mcp_as_a_judge import mcp as imported_mcp
2727

2828
assert imported_mcp is not None
29-
assert imported_mcp.name == "MCP as a Judge"
29+
assert imported_mcp.name == "MCP-as-a-Judge"

0 commit comments

Comments
 (0)