How to test that a testset fails expectedly?

Let’s say I have a package that defines a test macro. The macro creates some code that runs a @testset and inside a couple @tests. If I want to test that the macro works, I have to test that it succeeds if the conditions are right and that it fails when the conditions are wrong.

To test that it succeeds, I can just use it:

@testset "test that things work" begin
    @my_test some + successful + code
end

Now my question is, how do I test that the inner testset correctly fails when it’s supposed to? This doesn’t work because the function doesn’t actually throw, but it the spirit of what I’m trying to do:

@testset "test that things fail" begin
    @test_throws TestFailure @my_test some + failing + code
end

If I do something with the TestSet returned from @my_test I still think I can’t keep the outer testset from failing due to the way Test works internally, I can’t tell the outer testset to ignore the inner.