-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Catch warning in Experimental API test
- Loading branch information
Showing
1 changed file
with
5 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|