Skip to content

testmon fail to capture simple case setup_class #240

@thaiminhpv

Description

@thaiminhpv

Summary

After modifying setup_class function, pytest-testmon only run again TestClass::test_A, but not run again TestClass::test_B, and therefore still pass all (but expected to fail)

# test_class.py
class TestClass:
    def setup_class(self):
        self.array = ["A", "B"]
        # self.array = ["A"]  # after modification
        
    def test_A(self):
        assert "A" in self.array
    
    def test_B(self):
        assert "B" in self.array
> pip list | grep test
pytest                                   8.3.2
pytest-cov                               5.0.0
pytest-remotedata                        0.4.1
pytest-testmon                           2.1.1
pytest-xdist                             3.6.1

Note: This pytest setup schema is similar to a real-world project, and testmon failed this case
https://github.com/astropy/astropy/blob/5c7c9dda7fcf99eb38952f7944645b8879a39531/astropy/io/votable/tests/test_vo.py#L395

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions