Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cb0a486

Browse files
mikanizheehehe
authored andcommittedOct 3, 2023
test: fix to check in setUp method whether it is mariadb or not
1 parent 4b8833b commit cb0a486

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed
 

‎pymysqlreplication/tests/test_basic.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,9 +1300,12 @@ def tearDown(self):
13001300

13011301

13021302
class TestMariadbBinlogStreamReader(base.PyMySQLReplicationTestCase):
1303-
def test_binlog_checkpoint_event(self):
1303+
def setUp(self):
1304+
super().setUp()
13041305
if not self.isMariaDB():
1305-
self.skipTest("Database is not mariadb")
1306+
self.skipTest("Skipping the entire class for MariaDB")
1307+
1308+
def test_binlog_checkpoint_event(self):
13061309
self.stream.close()
13071310
self.stream = BinLogStreamReader(
13081311
self.database, server_id=1023, blocking=False, is_mariadb=True
@@ -1333,9 +1336,12 @@ def test_binlog_checkpoint_event(self):
13331336

13341337

13351338
class TestMariadbBinlogStreamReader2(base.PyMySQLReplicationTestCase):
1336-
def test_annotate_rows_event(self):
1339+
def setUp(self):
1340+
super().setUp()
13371341
if not self.isMariaDB():
1338-
self.skipTest("Database is not mariadb")
1342+
self.skipTest("Skipping the entire class for MariaDB")
1343+
1344+
def test_annotate_rows_event(self):
13391345
query = "CREATE TABLE test (id INT NOT NULL AUTO_INCREMENT, data VARCHAR (50) NOT NULL, PRIMARY KEY (id))"
13401346
self.execute(query)
13411347
# Insert first event
@@ -1364,8 +1370,6 @@ def test_annotate_rows_event(self):
13641370
self.assertIsInstance(event, MariadbAnnotateRowsEvent)
13651371

13661372
def test_start_encryption_event(self):
1367-
if not self.isMariaDB():
1368-
self.skipTest("Database is not mariadb")
13691373
query = "CREATE TABLE test (id INT NOT NULL AUTO_INCREMENT, data VARCHAR (50) NOT NULL, PRIMARY KEY (id))"
13701374
self.execute(query)
13711375
query = "INSERT INTO test (data) VALUES('Hello World')"
@@ -1404,8 +1408,6 @@ def test_start_encryption_event(self):
14041408
self.assertEqual(len(nonce), 12)
14051409

14061410
def test_gtid_list_event(self):
1407-
if not self.isMariaDB():
1408-
self.skipTest("Database is not mariadb")
14091411
# set max_binlog_size to create new binlog file
14101412
query = "SET GLOBAL max_binlog_size=4096"
14111413
self.execute(query)

0 commit comments

Comments
 (0)
Please sign in to comment.