[#22550] Remove TestData from series-tests test_rank.py
Part of #22550

* Replaced TestData usage in `pandas/tests/series/test_rank.py` with fixtures
* Switched from class-based test approach to function-based (**Note:** This is why the diff is so big)

- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

> * Switched from class-based test approach to function-based (**Note:** This is why the diff is so big)

Thanks for the PR. in future avoid this in the same PR as making changes. can always be done in a follow-up. Thanks for your review @simonjayhawkins!

I took care of your first two comments. Do you want me to create a new issue for the other comment you made about parametrisation? > I took care of your first two comments. Do you want me to create a new issue for the other comment you made about parametrisation?

see what @jreback has to say.

if the switch from class-based test approach to function-based is done as a follow-up instead of here, the additional fixtures won't be necessary here for the task of removing the TestData base class. in this case the parameterisation of the three tests that use the class variables could be done as a precursor to the switch. Gotcha. Just let me know if I should revert the class to function switch - it won't be a lot of effort and I wouldn't mind.

On another note: I'll probably also take care of replacing TestData for the other series modules over the coming days. Should I continue creating one PR per module or is it fine to group the remaining ones in a single PR (possibly doing 1 commit per file)?
After this one, there are 5 more files pending @simonjayhawkins @jreback I undid the class- to function-based transition to separate concerns and aid the review process.

Would be great if one of you could also reply to my previous comment. Cheers! > On another note: I'll probably also take care of replacing TestData for the other series modules over the coming days. Should I continue creating one PR per module or is it fine to group the remaining ones in a single PR (possibly doing 1 commit per file)?
> After this one, there are 5 more files pending

creating one PR per module is fine. @jreback Can this one be merged as well? I took care of all review comments thanks @SaturnFromTitan 