Don't do that. Python already doesn't really allow for overloaded functions (compared to other languages). And Fixtures can already be extended using different names.
@pytest.fixture
def values() -> list[int]:
return [1,2,3]
@pytest.fixture
def new_values(values: list[int]) -> list[int]:
return values + [4,5,6]
Another consideration of why your idea is bad... What happens when unit test are run in a different order? If your base is subclassed multiple times, how are the "values" fixture meant to be overwritten?
# Bad ideas are bad.
class Base:
@pytest.fixture
def values(self) -> list[int]:
return [1,2,3]
class TestChildA(Base):
@pytest.fixture
def values(self, values) -> list[int]:
return values + [4,5,6] # does this include 7,8,9?
class TestChildB(Base):
@pytest.fixture
def values(self, values) -> list[int]:
return values + [7,8,9] # does this also include 4,5,6?