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

kaxilnaik 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 aa5807453a1 Fix typo in mock spec parameter (#53206)
aa5807453a1 is described below

commit aa5807453a105e0179ae1f9c2af05510bb342a9d
Author: Kaxil Naik <[email protected]>
AuthorDate: Sat Jul 12 03:36:53 2025 +0530

    Fix typo in mock spec parameter (#53206)
    
    Changed 'speck=' to 'spec=' in Mock() calls for DogStatsd objects in 
test_stats.py.
    This typo prevented proper mock specification and could lead to less 
effective tests.
    
    Also improved test documentation by replacing TODO comment with proper 
docstring.
---
 airflow-core/tests/unit/core/test_stats.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/airflow-core/tests/unit/core/test_stats.py 
b/airflow-core/tests/unit/core/test_stats.py
index 10752d16fba..1dad2fcedd7 100644
--- a/airflow-core/tests/unit/core/test_stats.py
+++ b/airflow-core/tests/unit/core/test_stats.py
@@ -215,7 +215,7 @@ class TestDogStats:
         )
 
     def 
test_does_send_stats_using_dogstatsd_when_statsd_and_dogstatsd_both_on(self):
-        # ToDo: Figure out why it identical to 
test_does_send_stats_using_dogstatsd_when_dogstatsd_on
+        """Test that dogstatsd works when both statsd and dogstatsd are 
enabled (dogstatsd takes precedence)."""
         self.dogstatsd.incr("empty_key")
         self.dogstatsd_client.increment.assert_called_once_with(
             metric="empty_key", sample_rate=1, tags=[], value=1
@@ -389,7 +389,7 @@ class TestDogStatsWithAllowList:
         pytest.importorskip("datadog")
         from datadog import DogStatsd
 
-        self.dogstatsd_client = Mock(speck=DogStatsd)
+        self.dogstatsd_client = Mock(spec=DogStatsd)
         self.dogstats = SafeDogStatsdLogger(
             self.dogstatsd_client, PatternAllowListValidator("stats_one, 
stats_two")
         )
@@ -416,7 +416,7 @@ class TestDogStatsWithMetricsTags:
         pytest.importorskip("datadog")
         from datadog import DogStatsd
 
-        self.dogstatsd_client = Mock(speck=DogStatsd)
+        self.dogstatsd_client = Mock(spec=DogStatsd)
         self.dogstatsd = SafeDogStatsdLogger(self.dogstatsd_client, 
metrics_tags=True)
 
     def test_does_send_stats_using_dogstatsd_with_tags(self):
@@ -431,7 +431,7 @@ class TestDogStatsWithDisabledMetricsTags:
         pytest.importorskip("datadog")
         from datadog import DogStatsd
 
-        self.dogstatsd_client = Mock(speck=DogStatsd)
+        self.dogstatsd_client = Mock(spec=DogStatsd)
         self.dogstatsd = SafeDogStatsdLogger(
             self.dogstatsd_client,
             metrics_tags=True,

Reply via email to