Skip to content

looking for a simple way to label all tests in a TestCase with an attribute #641

@jnahmias

Description

@jnahmias

Hello,

Possibly this exists already, but I don't seem to find how... I have a test case with a bunch of tests in it. How can mark the entire class with an attribute so I can exclude/skip it when running nose2? Something like the following (made-up) syntax:

import unittest

@attr_all(my_attr=True)
class MyTestCase(unittest.TestCase):

    def test_func0(self):
        pass

    def test_func1(self):
        pass

So that when I run python3 -m nose2 --plugin nose2.plugins.attrib -A '!my_attr' all the tests in MyTestCase are skipped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions