TestItemRunner.jl icon indicating copy to clipboard operation
TestItemRunner.jl copied to clipboard

Apparent problem with @test_warn

Open kbarros opened this issue 3 years ago • 3 comments

It appears that placing @test_warn inside a @testitem block breaks the VSCode/Julia testing. When running a failing test for @test_warn, VSCode tries to open an editor window for Test.jl, which only shows the message "The editor could not be opened because the file was not found."

kbarros avatar Sep 30 '22 20:09 kbarros

I think this is essentially a problem in Base... If you look at the implementation of the @test_warn macro here you can see that it just calls the @test macro in turn. So the file location where the test is failing is actually not the location where the @test_warn macro is being called, instead it will report the location that I linked to here. And then it also seems that the default Julia stores filenames from the build bots for standard library locations, so then VS Code is trying to open a file that doesn't exist.

I think the proper way to fix this is to fix @test_warn to correctly report the location of the @test_warn invocation if it fails.

davidanthoff avatar Oct 04 '22 01:10 davidanthoff

https://github.com/JuliaLang/julia/issues/47033

davidanthoff avatar Oct 04 '22 01:10 davidanthoff