shahar1 opened a new pull request, #65581:
URL: https://github.com/apache/airflow/pull/65581

   ## Description
   
   Make werkzeug import optional in Google provider test conftest to fix test 
collection failures when werkzeug is not installed.
   
   ## Background
   
   The werkzeug import was added to Google provider's test conftest during the 
FAB connexion-to-FastAPI migration (PR #62664, commit f4fd68fb15 on March 6, 
2026), but it's not actually needed for most Google provider tests.
   
   - **FAB provider**: Legitimately needs werkzeug (5+ test files use Flask 
test client) ✅
   - **Google provider**: Only 1 test file (`test_google_openid.py`) uses Flask 
test client ❌
   
   The hard import was causing test collection failures for the other 99%+ of 
Google provider tests when werkzeug wasn't installed, even though they don't 
need it.
   
   ## Changes
   
   - Changed werkzeug import from hard import to optional try/except
   - Added None check before accessing werkzeug attributes
   - Maintains backward compatibility: tests that need werkzeug still work when 
it's available
   
   ## Testing
   
   Ran all Cloud Run unit tests successfully without werkzeug installed:
   ```bash
   uv run --project providers/google pytest 
providers/google/tests/unit/google/cloud/operators/test_cloud_run.py 
providers/google/tests/unit/google/cloud/hooks/test_cloud_run.py 
providers/google/tests/unit/google/cloud/links/test_cloud_run.py 
providers/google/tests/unit/google/cloud/triggers/test_cloud_run.py 
--with-db-init -xvs
   ```
   
   **Result**: 61 passed, 1 warning
   
   ## Notes
   
   - werkzeug was never part of Google provider in Airflow 2.X era
   - This unnecessary hard dependency was introduced as a blanket change 
appropriate for FAB provider but not for Google provider
   - FAB provider conftest correctly keeps werkzeug as a hard import (it 
genuinely needs it)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to