Skip to content

Doesn't work when using inside a class #18

@konpatp

Description

@konpatp

If my code is something like this:

class Test(TestCase):
    i = 0

    @pytest.mark.run(order=1)
    def test_c(self):
        assert self.i == 0
        self.i += 1

    @pytest.mark.run(order=2)
    def test_b(self):
        assert self.i == 1
        self.i += 1

    @pytest.mark.run(order=3)
    def test_a(self):
        assert self.i == 2
        self.i += 1

It says 'Empty test suite.', and when I change the marker into something like @pytest.mark.first, it still doesn't work. It seems to me that pytest doesn't obey these marks anymore.

How do I solve this ? or I'm doing it wrongly ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions