Skip to content

Commit

Permalink
Merge pull request #46 from jupyter-naas/fix-pytest
Browse files Browse the repository at this point in the history
Fix pytest
  • Loading branch information
Dr0p42 authored Jun 18, 2024
2 parents 73afa4a + 041f22c commit 1635545
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .github/hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh

# Execute the make target
make test

# Capture the exit status of the make command
STATUS=$?

# If the make command fails, exit with the same status
if [ $STATUS -ne 0 ]; then
echo "Pre-commit hook failed: make test failed with status $STATUS"
exit $STATUS
fi

# If the make command succeeds, allow the commit to proceed
exit 0
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
install-git-hooks:
cp .github/hooks/pre-commit .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit

.PHONY: install-git-hooks

all: install-git-hooks run

openapi-gen:
docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate \
-i /local/openapis/naas-openapi.json \
Expand Down
2 changes: 1 addition & 1 deletion tests/unitests/test_cli_with_mock_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_create_valid_registry(mock_domain, capsys):

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


Expand Down

0 comments on commit 1635545

Please sign in to comment.