@@ -43,7 +43,9 @@ def test_instrument_api(self) -> None:
4343 )
4444
4545 @patch ("opentelemetry.instrumentation.kafka.distribution" )
46- def test_instrumentation_dependencies_kafka_python_installed (self , mock_distribution ) -> None :
46+ def test_instrumentation_dependencies_kafka_python_installed (
47+ self , mock_distribution
48+ ) -> None :
4749 instrumentation = KafkaInstrumentor ()
4850
4951 def _distribution (name ):
@@ -55,14 +57,19 @@ def _distribution(name):
5557 package_to_instrument = instrumentation .instrumentation_dependencies ()
5658
5759 self .assertEqual (mock_distribution .call_count , 2 )
58- self .assertEqual (mock_distribution .mock_calls , [
59- call ("kafka-python-ng" ),
60- call ("kafka-python" ),
61- ])
60+ self .assertEqual (
61+ mock_distribution .mock_calls ,
62+ [
63+ call ("kafka-python-ng" ),
64+ call ("kafka-python" ),
65+ ],
66+ )
6267 self .assertEqual (package_to_instrument , (_instruments_kafka_python ,))
6368
6469 @patch ("opentelemetry.instrumentation.kafka.distribution" )
65- def test_instrumentation_dependencies_kafka_python_ng_installed (self , mock_distribution ) -> None :
70+ def test_instrumentation_dependencies_kafka_python_ng_installed (
71+ self , mock_distribution
72+ ) -> None :
6673 instrumentation = KafkaInstrumentor ()
6774
6875 def _distribution (name ):
@@ -74,13 +81,17 @@ def _distribution(name):
7481 package_to_instrument = instrumentation .instrumentation_dependencies ()
7582
7683 self .assertEqual (mock_distribution .call_count , 1 )
77- self .assertEqual (mock_distribution .mock_calls , [
78- call ("kafka-python-ng" )
79- ])
80- self .assertEqual (package_to_instrument , (_instruments_kafka_python_ng ,))
84+ self .assertEqual (
85+ mock_distribution .mock_calls , [call ("kafka-python-ng" )]
86+ )
87+ self .assertEqual (
88+ package_to_instrument , (_instruments_kafka_python_ng ,)
89+ )
8190
8291 @patch ("opentelemetry.instrumentation.kafka.distribution" )
83- def test_instrumentation_dependencies_both_installed (self , mock_distribution ) -> None :
92+ def test_instrumentation_dependencies_both_installed (
93+ self , mock_distribution
94+ ) -> None :
8495 instrumentation = KafkaInstrumentor ()
8596
8697 def _distribution (name ):
@@ -93,13 +104,17 @@ def _distribution(name):
93104 package_to_instrument = instrumentation .instrumentation_dependencies ()
94105
95106 self .assertEqual (mock_distribution .call_count , 1 )
96- self .assertEqual (mock_distribution .mock_calls , [
97- call ("kafka-python-ng" )
98- ])
99- self .assertEqual (package_to_instrument , (_instruments_kafka_python_ng ,))
107+ self .assertEqual (
108+ mock_distribution .mock_calls , [call ("kafka-python-ng" )]
109+ )
110+ self .assertEqual (
111+ package_to_instrument , (_instruments_kafka_python_ng ,)
112+ )
100113
101114 @patch ("opentelemetry.instrumentation.kafka.distribution" )
102- def test_instrumentation_dependencies_none_installed (self , mock_distribution ) -> None :
115+ def test_instrumentation_dependencies_none_installed (
116+ self , mock_distribution
117+ ) -> None :
103118 instrumentation = KafkaInstrumentor ()
104119
105120 def _distribution (name ):
@@ -120,8 +135,11 @@ def _distribution(name):
120135 assert package_to_instrument == _instruments
121136
122137 self .assertEqual (mock_distribution .call_count , 2 )
123- self .assertEqual (mock_distribution .mock_calls , [
124- call ("kafka-python-ng" ),
125- call ("kafka-python" ),
126- ])
138+ self .assertEqual (
139+ mock_distribution .mock_calls ,
140+ [
141+ call ("kafka-python-ng" ),
142+ call ("kafka-python" ),
143+ ],
144+ )
127145 self .assertEqual (package_to_instrument , _instruments )
0 commit comments