Closed
Description
https://github.com/pandas-dev/pandas/blob/master/pandas/tests/indexes/test_base.py#L36 we define a lot of self.indices
that are used in testing (mostly in .common.py
), where we iteratore over .indices.values()
if this were made into a parameterize fixture, then the tests can be changed to be a lot simpler. something like.
@pytest.fixture(params=[tm.makeUnicodeIndex(...), tm.make......])
def index(request):
return request.param
# in common.py
def test_wrong_number_names(self, index):
def testit(ind):
ind.names = ["apple", "banana", "carrot"]
tm.assert_raises_regex(ValueError, "^Length", testit, index)