Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: Context not given when @testset let errors #57779

Open
IanButterworth opened this issue Mar 15, 2025 · 0 comments
Open

Test: Context not given when @testset let errors #57779

IanButterworth opened this issue Mar 15, 2025 · 0 comments
Labels
testsystem The unit testing framework and Test stdlib

Comments

@IanButterworth
Copy link
Member

This has context.

julia> @testset let x = 1
       @test x == 2
       end
Test Failed at REPL[7]:2
  Expression: x == 2
   Evaluated: 1 == 2
     Context: x = 1

ERROR: There was an error during testing

This doesn't, and I think it should

julia> @testset let x = 1
       @test error()
       end
Error During Test at REPL[8]:2
  Test threw exception
  Expression: error()

  Stacktrace:
   [1] error()
     @ Base ./error.jl:45
   [2] top-level scope
     @ REPL[8]:0
   [3] macro expansion
     @ ~/Documents/GitHub/julia/usr/share/julia/stdlib/v1.13/Test/src/Test.jl:1703 [inlined]
   [4] macro expansion
     @ REPL[8]:2 [inlined]
   [5] macro expansion
     @ ~/Documents/GitHub/julia/usr/share/julia/stdlib/v1.13/Test/src/Test.jl:676 [inlined]
   [6] macro expansion
     @ REPL[8]:2 [inlined]
ERROR: There was an error during testing
@IanButterworth IanButterworth added the testsystem The unit testing framework and Test stdlib label Mar 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testsystem The unit testing framework and Test stdlib
Projects
None yet
Development

No branches or pull requests

1 participant