Skip to content

Commit

Permalink
Catch warning in Experimental API test
Browse files Browse the repository at this point in the history
  • Loading branch information
Taragolis committed Apr 23, 2024
1 parent 0e7a491 commit 2a7d641
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/api_experimental/auth/backend/test_basic_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import pytest
from flask_login import current_user

from airflow.exceptions import RemovedInAirflow3Warning
from tests.test_utils.db import clear_db_pools

pytestmark = pytest.mark.db_test
Expand Down Expand Up @@ -49,7 +50,10 @@ def test_success(self):
clear_db_pools()

with self.app.test_client() as test_client:
response = test_client.get("/api/experimental/pools", headers={"Authorization": token})
with pytest.warns(RemovedInAirflow3Warning, match=r"Use Pool.get_pools\(\) instead"):
# Experimental client itself deprecated, no reason to change to actual methods
# It should be removed in the same time: Airflow 3.0
response = test_client.get("/api/experimental/pools", headers={"Authorization": token})
assert current_user.email == "[email protected]"

assert response.status_code == 200
Expand Down

0 comments on commit 2a7d641

Please sign in to comment.