Skip to content
Discussion options

You must be logged in to vote

Out of the box - No, there isn't a clean way to do this.

Your workaround is a good solution for now - But as you say, it's not ideal, and it's extra work on you having to maintain that attribute.

I'd need to build something into TUnit to allow these to be mergeable.

I'm thinking something like an InheritParentKeys property on the attribute or something.

    [NotInParallel(X)]
    public class ATests : BaseA
    {
        [Test]
        public async Task DesiredTestA1() => await Action();

        [Test]
        public async Task DesiredTestA2() => await Action();

        [Test]
        [NotInParallel(Y, InheritParentKeys = true)]
        public async Task DesiredTestAB() => await Action();

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by DmitryKomarov
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants