Skip to content

Commit 1635545

Browse files
authored
Merge pull request #46 from jupyter-naas/fix-pytest
Fix pytest
2 parents 73afa4a + 041f22c commit 1635545

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

.github/hooks/pre-commit

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/sh
2+
3+
# Execute the make target
4+
make test
5+
6+
# Capture the exit status of the make command
7+
STATUS=$?
8+
9+
# If the make command fails, exit with the same status
10+
if [ $STATUS -ne 0 ]; then
11+
echo "Pre-commit hook failed: make test failed with status $STATUS"
12+
exit $STATUS
13+
fi
14+
15+
# If the make command succeeds, allow the commit to proceed
16+
exit 0

Makefile

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
install-git-hooks:
2+
cp .github/hooks/pre-commit .git/hooks/pre-commit
3+
chmod +x .git/hooks/pre-commit
4+
5+
.PHONY: install-git-hooks
6+
7+
all: install-git-hooks run
8+
19
openapi-gen:
210
docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate \
311
-i /local/openapis/naas-openapi.json \

tests/unitests/test_cli_with_mock_domain.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def test_create_valid_registry(mock_domain, capsys):
5454

5555
def test_create_invalid_registry(mock_domain):
5656
app = TyperRegistryAdaptor(mock_domain)
57-
with pytest.raises(ValidationError, match="string does not match regex"):
57+
with pytest.raises(ValidationError, match="1 validation error for Registry"):
5858
app.create("invalid_registry_name", rich_preview=False)
5959

6060

0 commit comments

Comments
 (0)