addresses GH #21646
- [x] closes #21646
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

This allows pytest to be called from any directory within the project and successfully run tests using the datapath fixture. # [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/21647?src=pr&el=h1) Report
> Merging [#21647](https://codecov.io/gh/pandas-dev/pandas/pull/21647?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/45e55af9cf74aede00a8b10f8922537f285a573a?src=pr&el=desc) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/21647/graphs/tree.svg?width=650&src=pr&token=eZ4WkYLtcO&height=150)](https://codecov.io/gh/pandas-dev/pandas/pull/21647?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master   #21647   +/-   ##
=======================================
  Coverage    91.9%    91.9%           
=======================================
  Files         154      154           
  Lines       49558    49558           
=======================================
  Hits        45545    45545           
  Misses       4013     4013
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.27% <ø> (ø)` | :arrow_up: |
| #single | `42.02% <ø> (ø)` | :arrow_up: |


------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/21647?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/21647?src=pr&el=footer). Last update [45e55af...ebca56c](https://codecov.io/gh/pandas-dev/pandas/pull/21647?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
 Thanks!