backport-1.8-3910

Backport #3910: `MAINT: update runtests.py from scipy`.