test: implement unit testing suite with pytest and add pre-push verification hook
This commit is contained in:
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
# pre-push hook: runs unit tests before every git push
|
||||
# To bypass: git push --no-verify
|
||||
|
||||
echo "🧪 Running unit tests..."
|
||||
|
||||
uv run pytest tests/unit/ -q
|
||||
exit_code=$?
|
||||
|
||||
if [ $exit_code -ne 0 ]; then
|
||||
echo ""
|
||||
echo "❌ Unit tests failed. Push aborted."
|
||||
echo " To bypass: git push --no-verify"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ All unit tests passed."
|
||||
exit 0
|
||||
Reference in New Issue
Block a user