This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 2bf24964bec Fix broken canary, remove unneeded crypto key generation 
(#58074)
2bf24964bec is described below

commit 2bf24964beceeaf2689cddc751b73aec3e18cbfc
Author: Jens Scheffler <[email protected]>
AuthorDate: Sat Nov 8 12:01:38 2025 +0100

    Fix broken canary, remove unneeded crypto key generation (#58074)
---
 airflow-core/tests/unit/always/test_connection.py |  2 --
 airflow-core/tests/unit/models/test_connection.py | 12 ------------
 2 files changed, 14 deletions(-)

diff --git a/airflow-core/tests/unit/always/test_connection.py 
b/airflow-core/tests/unit/always/test_connection.py
index 5805ef49b5d..d613c0d77da 100644
--- a/airflow-core/tests/unit/always/test_connection.py
+++ b/airflow-core/tests/unit/always/test_connection.py
@@ -103,12 +103,10 @@ class UriTestCaseConfig:
 
 class TestConnection:
     def setup_method(self):
-        crypto._fernet = None
         self.patcher = mock.patch("airflow.models.connection.mask_secret", 
autospec=True)
         self.mask_secret = self.patcher.start()
 
     def teardown_method(self):
-        crypto._fernet = None
         self.patcher.stop()
 
     @conf_vars({("core", "fernet_key"): ""})
diff --git a/airflow-core/tests/unit/models/test_connection.py 
b/airflow-core/tests/unit/models/test_connection.py
index bf5a1b6a8f4..d39f3339b99 100644
--- a/airflow-core/tests/unit/models/test_connection.py
+++ b/airflow-core/tests/unit/models/test_connection.py
@@ -23,14 +23,12 @@ from typing import TYPE_CHECKING
 from unittest import mock
 
 import pytest
-from cryptography.fernet import Fernet
 
 from airflow.exceptions import AirflowException, AirflowNotFoundException
 from airflow.models import Connection
 from airflow.sdk.exceptions import AirflowRuntimeError, ErrorType
 from airflow.sdk.execution_time.comms import ErrorResponse
 
-from tests_common.test_utils.config import conf_vars
 from tests_common.test_utils.db import clear_db_connections
 
 if TYPE_CHECKING:
@@ -40,15 +38,6 @@ if TYPE_CHECKING:
 
 
 class TestConnection:
-    @pytest.fixture(autouse=True)
-    def clear_fernet_cache(self):
-        """Clear the fernet cache before each test to avoid encryption 
issues."""
-        from airflow.models.crypto import get_fernet
-
-        get_fernet.cache_clear()
-        yield
-        get_fernet.cache_clear()
-
     @pytest.mark.parametrize(
         (
             "uri",
@@ -216,7 +205,6 @@ class TestConnection:
             ),
         ],
     )
-    @conf_vars({("core", "fernet_key"): Fernet.generate_key().decode()})
     def test_get_uri(self, connection, expected_uri):
         assert connection.get_uri() == expected_uri
 

Reply via email to