See test failures at https://travis-ci.org/drush-ops/drush/jobs/237376086.
To reproduce, make sure you have php7 on your path. The steps below build a Composer project in your temp directory. That project contains latest Drush (symlinked in) and latest Drupal 8.4.x. The final line, 'sut', runs the Drush site-install command in that Composer project. You can set the environment variable UNISH_DB_URL=[mysql://root:@127.0.0.1] if you don't like the default I have there.
git clone https://github.com/drush-ops/drush.git
cd drush
COMPOSER=composer-highest.json ./unish.sut.php
./sut site-install testing --db-url=[URL] -d -y