Ported over Jason Zaugg's fix in branch 2.1.x to master.
Ported over Jason Zaugg's fix in branch 2.1.x to master.

matterche/scalatest,janekdb/scalatest,rahulkavale/scalatest,dotty-staging/scalatest,triggerNZ/scalatest,scalatest/scalatest,rfries/scalatest,janekdb/scalatest,triggerNZ/scalatest,gcberger/scalatest,matterche/scalatest,cheeseng/scalatest,rfries/scalatest,scalatest/scalatest,cheeseng/scalatest,SRGOM/scalatest,flicken/scalatest,gcberger/scalatest,matterche/scalatest,janekdb/scalatest,SRGOM/scalatest,rahulkavale/scalatest,dotty-staging/scalatest,janekdb/scalatest,cheeseng/scalatest,dotty-staging/scalatest,gcberger/scalatest,flicken/scalatest,triggerNZ/scalatest,flicken/scalatest,matterche/scalatest,SRGOM/scalatest,scalatest/scalatest,triggerNZ/scalatest,gcberger/scalatest,flicken/scalatest,rahulkavale/scalatest,rfries/scalatest,SRGOM/scalatest,rfries/scalatest,rahulkavale/scalatest