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

functions to get the (flattened) list of results by type #2

Open
nickrobinson251 opened this issue May 18, 2023 · 1 comment
Open

Comments

@nickrobinson251
Copy link
Contributor

nickrobinson251 commented May 18, 2023

e.g. like https://github.com/JuliaTesting/ReTestItems.jl/blob/498097bd04a9f890b8623c0d0857ab5dd534890d/test/_integration_test_tools.jl#L71-L89

effectively a generalisation of the current nonpassing_results

@nickrobinson251 nickrobinson251 changed the title function to get the (flattened) list of results by type functions to get the (flattened) list of results by type May 18, 2023
@nickrobinson251
Copy link
Contributor Author

i'm thinking the usage would be like:

@testset begin
    results = capture_results() do  # <- return an EncasedTestSet, so we can iterrogate the results
       my_tester_function() 
    end
    # test we saw the one error we expected
    err = only(get_errors(results))
    @test err.test_type == :nontest_error
    @test err.value == string(ErrorException("test item \"Abort\" didn't succeed after 1 tries"))
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant