I would like to structure my pytests in a class to test a pipeline where I load and modify the data. To do so I created something like the below example. But the second test fails because self.data is still None.
class TestClass:
data = None
def test_load_data(self):
self.data = [1, 2, 3]
assert isinstance(self.data, list)
def test_modify_data(self):
self.data.append(4)
assert len(self.data) is 4
Why is this not working and how do I pass the content of one test to another?