You can run tests in MySQL in memory almost as easily.
database-autotests:
volumes:
- mysql-autotests-volume:/var/lib/mysql
volumes:
mysql-autotests-volume:
driver_opts:
type: tmpfs
o: "size=2G,mode=777"
device: tmpfs
It's also very fast and allows to test the code on the same database, especially if you have something MySQL-specific.