fix(project): stabilize python3 tests and app shutdown
Use python3/venv consistently for local test execution and make package discovery deterministic for pytest. Also migrate FastAPI shutdown handling to lifespan to remove deprecation warnings while preserving cleanup behavior.
This commit is contained in:
1 parent
572d551a2c
commit
b2ee220783
4 files changed
+29
-8
No files matched your search
+12
-2
@@ -3,8 +3,18 @@ set -euo pipefail
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
if ! command -v python3 >/dev/null 2>&1; then
|
||||
echo "python3 non trovato nel PATH." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -x ".venv/bin/python3" ]]; then
|
||||
echo "Creating virtual environment..."
|
||||
python3 -m venv .venv
|
||||
fi
|
||||
|
||||
echo "Installing dependencies..."
|
||||
python -m pip install -r requirements.txt >/dev/null
|
||||
.venv/bin/python3 -m pip install -r requirements.txt >/dev/null
|
||||
|
||||
echo "Running pytest..."
|
||||
python -m pytest tests
|
||||
PYTHONPATH=. .venv/bin/python3 -m pytest tests
|
||||
Reference in new issue
Block a user