Turn DeprecationWarnings into exceptions during testing.