Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ repos:
^airflow-ctl.*\.py$|
^airflow-core/src/airflow/models/.*\.py$|
^airflow-core/tests/unit/api_fastapi/core_api/routes/public/test_assets.py$|
^airflow-core/tests/unit/models/test_pool.py$|
^airflow-core/tests/unit/utils/test_db_cleanup.py$|
^dev/airflow_perf/scheduler_dag_execution_timing.py$|
^providers/openlineage/.*\.py$|
Expand Down
7 changes: 4 additions & 3 deletions airflow-core/tests/unit/models/test_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import pendulum
import pytest
from sqlalchemy import func, select

from airflow import settings
from airflow.exceptions import AirflowException, PoolNotFound
Expand Down Expand Up @@ -292,7 +293,7 @@ def test_create_pool(self, session):
assert pool.slots == 5
assert pool.description == ""
assert pool.include_deferred is True
assert session.query(Pool).count() == self.TOTAL_POOL_COUNT + 1
assert session.scalar(select(func.count()).select_from(Pool)) == self.TOTAL_POOL_COUNT + 1

def test_create_pool_existing(self, session):
self.add_pools()
Expand All @@ -303,13 +304,13 @@ def test_create_pool_existing(self, session):
assert pool.slots == 5
assert pool.description == ""
assert pool.include_deferred is False
assert session.query(Pool).count() == self.TOTAL_POOL_COUNT
assert session.scalar(select(func.count()).select_from(Pool)) == self.TOTAL_POOL_COUNT

def test_delete_pool(self, session):
self.add_pools()
pool = Pool.delete_pool(name=self.pools[-1].pool)
assert pool.pool == self.pools[-1].pool
assert session.query(Pool).count() == self.TOTAL_POOL_COUNT - 1
assert session.scalar(select(func.count()).select_from(Pool)) == self.TOTAL_POOL_COUNT - 1

def test_delete_pool_non_existing(self):
with pytest.raises(PoolNotFound, match="^Pool 'test' doesn't exist$"):
Expand Down