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

at_test_nowarn does not suppress the content of stderr anymore #39028

Merged
merged 2 commits into from
Apr 21, 2021

Conversation

ranocha
Copy link
Member

@ranocha ranocha commented Dec 29, 2020

Currently, I get something like

julia> using Test

julia> @test_nowarn println(stderr, "Some informative warning helpful for debugging failing tests")
Test Failed at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/Test/src/Test.jl:636
  Expression: contains_warn(read(fname, String), $(Expr(:escape, :(r"^(?!.)"s))))
ERROR: There was an error during testing

This doesn't really help much when debugging failing tests. This PR changes the output to

julia> using Test

julia> @test_nowarn println(stderr, "Some informative warning helpful for debugging failing tests")
Some informative warning helpful for debugging failing tests
Test Failed at /home/hendrik/Software/julia/usr/share/julia/stdlib/v1.7/Test/src/Test.jl:702
  Expression: isempty(stderr_content)
   Evaluated: isempty("Some informative warning helpful for debugging failing tests\n")
ERROR: There was an error during testing

This is helpful for me when trying to debug failing tests in packages using @test_nowarn.

@ranocha
Copy link
Member Author

ranocha commented Jan 5, 2021

I don't see how the changes of this PR could cause the test failure.

@ranocha ranocha closed this Feb 10, 2021
@ranocha ranocha reopened this Feb 10, 2021
@ranocha
Copy link
Member Author

ranocha commented Feb 10, 2021

An appropriate label might be error massages(but I can't add labels).

@vtjnash vtjnash added the domain:error messages Better, more actionable error messages label Apr 19, 2021
stdlib/Test/src/Test.jl Outdated Show resolved Hide resolved
stdlib/Test/src/Test.jl Outdated Show resolved Hide resolved
@vtjnash vtjnash added the status:merge me PR is reviewed. Merge when all tests are passing label Apr 19, 2021
@vtjnash
Copy link
Sponsor Member

vtjnash commented Apr 19, 2021

Sorry for the review delay. This sound good to me. I made some minor formatting changes, and then will merge when CI finishes.

@dkarrasch dkarrasch merged commit 9520c69 into JuliaLang:master Apr 21, 2021
@simeonschaub simeonschaub removed the status:merge me PR is reviewed. Merge when all tests are passing label Apr 28, 2021
ElOceanografo pushed a commit to ElOceanografo/julia that referenced this pull request May 4, 2021
antoine-levitt pushed a commit to antoine-levitt/julia that referenced this pull request May 9, 2021
johanmon pushed a commit to johanmon/julia that referenced this pull request Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:error messages Better, more actionable error messages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants