@@ -43,7 +43,9 @@ def test_instrument_api(self) -> None:
43
43
)
44
44
45
45
@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 :
47
49
instrumentation = KafkaInstrumentor ()
48
50
49
51
def _distribution (name ):
@@ -55,14 +57,19 @@ def _distribution(name):
55
57
package_to_instrument = instrumentation .instrumentation_dependencies ()
56
58
57
59
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
+ )
62
67
self .assertEqual (package_to_instrument , (_instruments_kafka_python ,))
63
68
64
69
@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 :
66
73
instrumentation = KafkaInstrumentor ()
67
74
68
75
def _distribution (name ):
@@ -74,13 +81,17 @@ def _distribution(name):
74
81
package_to_instrument = instrumentation .instrumentation_dependencies ()
75
82
76
83
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
+ )
81
90
82
91
@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 :
84
95
instrumentation = KafkaInstrumentor ()
85
96
86
97
def _distribution (name ):
@@ -93,13 +104,17 @@ def _distribution(name):
93
104
package_to_instrument = instrumentation .instrumentation_dependencies ()
94
105
95
106
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
+ )
100
113
101
114
@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 :
103
118
instrumentation = KafkaInstrumentor ()
104
119
105
120
def _distribution (name ):
@@ -120,8 +135,11 @@ def _distribution(name):
120
135
assert package_to_instrument == _instruments
121
136
122
137
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
+ )
127
145
self .assertEqual (package_to_instrument , _instruments )
0 commit comments