Skip to content

Commit a9642ae

Browse files
Rm test attempt
1 parent d3add81 commit a9642ae

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

tests/opentelemetry-docker-tests/tests/mysql/test_mysql_sqlcommenter.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414

1515
import os
16-
from unittest.mock import patch
1716

1817
import mysql.connector
1918

@@ -80,29 +79,3 @@ def test_commenter_enabled_connection_proxy(self):
8079
cursor.close()
8180
MySQLInstrumentor().uninstrument_connection(instrumented_cnx)
8281
cnx.close()
83-
84-
def test_commenter_enabled_unknown_mysql_client_version(self):
85-
MySQLInstrumentor().instrument(enable_commenter=True)
86-
cnx = mysql.connector.connect(
87-
user=MYSQL_USER,
88-
password=MYSQL_PASSWORD,
89-
host=MYSQL_HOST,
90-
port=MYSQL_PORT,
91-
database=MYSQL_DB_NAME,
92-
)
93-
cursor = cnx.cursor()
94-
95-
# Mock get_client_info to raise AttributeError
96-
with patch.object(cursor._cnx._cmysql, 'get_client_info', side_effect=AttributeError("Mocked error")):
97-
cursor.execute("SELECT 1;")
98-
cursor.fetchall()
99-
100-
self.assertRegex(
101-
cursor.statement,
102-
r"SELECT 1 /\*db_driver='mysql\.connector[^']*',dbapi_level='\d\.\d',dbapi_threadsafety=\d,driver_paramstyle='[^']*',mysql_client_version='unknown',traceparent='[^']*'\*/;",
103-
)
104-
self.assertIn("mysql_client_version='unknown'", cursor.statement)
105-
106-
cursor.close()
107-
cnx.close()
108-
MySQLInstrumentor().uninstrument()

0 commit comments

Comments
 (0)