So instead of creating a class based on the database, we'd like to change the test structure,
so that we only need to parameterize which database we want to test against and the entire list of tests will be triggered.
Changes
We added database setting information to pymysqlreplication/tests/config.json.
In order to get parameter in pytest, we added pymysqlreplication/tests/conftest.py
and use --db parameter when running pytest.
With this --db parameter, we set up PyMySQLReplicationTestCase
based on the entered target database to be tested.
Thus we could run tests for multiple databases without db-dependent classes
: PyMySQLReplicationMariaDbTestCase, PyMySQLReplicationVersion8TestCase
Resolve #499
Overview
As we add test for MySQL 8 in https://github.com/julien-duponchelle/python-mysql-replication/pull/484, we need to create an additional class to test everything against MySQL 8.
So instead of creating a class based on the database, we'd like to change the test structure, so that we only need to parameterize which database we want to test against and the entire list of tests will be triggered.
Changes
pymysqlreplication/tests/config.json
.pymysqlreplication/tests/conftest.py
and use--db
parameter when running pytest.--db
parameter, we set upPyMySQLReplicationTestCase
based on the entered target database to be tested.PyMySQLReplicationMariaDbTestCase
,PyMySQLReplicationVersion8TestCase
Result
Collaborated with @mjs1995 @mikaniz @starcat37