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

Working directory when running tests is VS Code

Open korbinian90 opened this issue 3 years ago • 1 comments

The working directory when running a @testset via the vs code UI is "C:\Users\korbi\AppData\Local\Programs\Microsoft VS Code". The default julia package test runs in "test" inside the package being tested.

This makes it complicated to reference data in the repository used for testing purposes. If the path working directory would be identical, @testset could simply be replaced with @testitem.

Otherwise, this is an amazing feature! The tests run instantly!

korbinian90 avatar Oct 06 '22 12:10 korbinian90

Solved this for now for my use case:

@testitem "test" begin
cd(@__DIR__)
load_data("data/small")
...

You can keep this open or close it as you prefer ;)

korbinian90 avatar Oct 06 '22 12:10 korbinian90

I think this is now properly fixed.

davidanthoff avatar Oct 04 '24 22:10 davidanthoff