Category inclusion/exclusion is ignored when it comes to SetUpFixtures

Bug #616226 reported by Yodan Tauber
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
NUnit Framework
Triaged
Low
Unassigned

Bug Description

[Issue now tracked at https://github.com/nunit/nunit-framework/issues/39]

In my DLL there are a few TestFixtures, divided to various categories with the Category attribute.
There's also one SetUpFixture that has a global SetUp method, and it's marked with Category("OneCategory").

When I run nunit (either console or GUI) with "/include=OneCategory", the global SetUp method runs, followed by all tests from OneCategory. This is great. However, when I run nunit with "/include=OtherCategory", the same global SetUp method still runs - followed by all tests from OtherCategory. Adding an explicit "/exclude=OneCategory" doesn't seem to help either.

I'd expect that category inclusion and exclusion would also affect the SetUpFixtures that run, not only TestFixtures that run.

Revision history for this message
Charlie Poole (charlie.poole) wrote : Re: [Bug 616226] [NEW] Category inclusion/exclusion is ignored when it comes to SetUpFixtures

This behavior is by design. When any test is selected, either by name
or by category,
all higher level setups are run.

While we probably won't "fix" this bug, I'm keeping it so we can at lest clarify
how categories work in the docs.

You might want to discuss this on the nunit-discuss list to see whether other
folks would like to see it work differently.

Charlie

On Wed, Aug 11, 2010 at 1:12 AM, Yodan Tauber <email address hidden> wrote:
> Public bug reported:
>
> In my DLL there are a few TestFixtures, divided to various categories with the Category attribute.
> There's also one SetUpFixture that has a global SetUp method, and it's marked with Category("OneCategory").
>
> When I run nunit (either console or GUI) with "/include=OneCategory",
> the global SetUp method runs, followed by all tests from OneCategory.
> This is great. However, when I run nunit with "/include=OtherCategory",
> the same global SetUp method still runs - followed by all tests from
> OtherCategory. Adding an explicit "/exclude=OneCategory" doesn't seem to
> help either.
>
> I'd expect that category inclusion and exclusion would also affect the
> SetUpFixtures that run, not only TestFixtures that run.
>
> ** Affects: nunitv2
>     Importance: Undecided
>         Status: New
>
> --
> Category inclusion/exclusion is ignored when it comes to SetUpFixtures
> https://bugs.launchpad.net/bugs/616226
> You received this bug notification because you are a member of NUnit
> Developers, which is subscribed to NUnit V2.
>

Revision history for this message
Charlie Poole (charlie.poole) wrote :

We'll consider this feature in 3.0

affects: nunitv2 → nunit-3.0
tags: added: feature framework
Changed in nunit-3.0:
status: New → Triaged
importance: Undecided → Low
description: updated
tags: added: github
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.