@@ -86,16 +86,12 @@ def test_stop_group_replication():
8686def test_start_group_replication_fail ():
8787 """Test startgroupreplication function with failure."""
8888 from ansible_collections .community .mysql .plugins .modules .mysql_replication import startgroupreplication
89- import pymysql
9089
9190 cursor = MockCursor (status = "ERROR" )
9291 module = type ('obj' , (object ,), {
9392 'fail_json' : lambda msg : None ,
9493 })
9594
96- # Mock the Warning exception
97- pymysql .Warning = Exception
98-
9995 result = startgroupreplication (module , cursor , [], True )
10096
10197 assert result is False
@@ -104,16 +100,12 @@ def test_start_group_replication_fail():
104100def test_stop_group_replication_fail ():
105101 """Test stopgroupreplication function with failure."""
106102 from ansible_collections .community .mysql .plugins .modules .mysql_replication import stopgroupreplication
107- import pymysql
108103
109104 cursor = MockCursor (status = "ERROR" )
110105 module = type ('obj' , (object ,), {
111106 'fail_json' : lambda msg : None ,
112107 })
113108
114- # Mock the Warning exception
115- pymysql .Warning = Exception
116-
117109 result = stopgroupreplication (module , cursor , True )
118110
119111 assert result is False
0 commit comments