Skip to content

SetUpFixture not being triggered when running tests using --testlist #3390

Description

@mcopjan

NUnitLite 3.12.0 (.NET Standard 2.0)

I have some code which is loading configuration in SetUpFixture class. I have noticed that this code is not being triggered when tests are executed using --testlist parameter.

Steps to reproduce:
1] Create a SetUpFixture which does not belong to any namespace (will be always triggered)

using System;
using NUnit.Framework;

[SetUpFixture]
public class SetUpFixture
{
    public SetUpFixture()
    {
        Console.WriteLine("Hello from SetUpFixture.");
    }
}

2]Create a simple test

using System;
using NUnit.Framework;

namespace TestAutomation.Dashboard.Tests.Features
{
    public class DummyTest
    {
        [Test]
        public void TestSetUpFixture()
        {
            Console.WriteLine("Hello from the Test.");
        }
    }
}
  • Execute using where expression:

image

  • Executing using --testlist
    image

As visible from the output above, when using --testlist there is no log message from the SetUpFixture.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions