Fix warnings in tests

Calling test_throws without specifying a single exception type is now deprecated (see https://github.com/JuliaLang/julia/pull/6475).