I have the following test file
import pytest
def my_list_imp():
return [1, 2, 3, 4, 5]
class TestParent:
@pytest.mark.parametrize("item", my_list_imp())
def test_item(self, item):
print("item: ", item)
assert item < 6
What is the proper way to inherit the TestParent class in another file and override only my_list_imp (so it can return a different list)? How to design the parent and child class, so only the list with items is overriden in the child?
If I make my_list_imp a method of the class, I do not know how to call it inside "parametrize" argument?
I need to use parametrize in order to execute the tests in parallel.
Thanks in advance