Since TYPO3 9.4 [1] there is support for SQLite in TYPO3, This is recommended for small websites, development environments or testing.
But I don't know how to use this in testing context, the MySQL I've used for ages like this TYPO3_PATH_WEB=$PWD/.Build/Web typo3DatabaseName=database typo3DatabaseHost=localhost typo3DatabaseUsername=root typo3DatabasePassword=root .Build/bin/phpunit -c config.xml Tests/Functional
I'm looking into this option with the hope of being able to speed up my functional testing, which I currently finds to slow.
You need sqlite on the server or in the docker container where you run your tests and then simply set
typo3DatabaseDriver=pdo_sqlite
as environment variable in front of your command. That's sufficient to run your tests with sqlite.
I've written an article where I cover this too.