diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2021-01-18 10:30:11 -0500 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2021-01-18 10:30:11 -0500 |
| commit | 31b0896bba77f21984dfad5a0b82fcd57bda9658 (patch) | |
| tree | 9bbb6b63477ca6dce682e384f31f52c5811e15d6 /setuptools/tests | |
| parent | 3c8e758caa11abe63040058ba136a68d2b620ea3 (diff) | |
| download | python-setuptools-git-31b0896bba77f21984dfad5a0b82fcd57bda9658.tar.gz | |
Rely on rootdir to determine the source. Avoids coupling with position in the test suite.
Diffstat (limited to 'setuptools/tests')
| -rw-r--r-- | setuptools/tests/fixtures.py | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/setuptools/tests/fixtures.py b/setuptools/tests/fixtures.py index 4a990eb9..d975c0fc 100644 --- a/setuptools/tests/fixtures.py +++ b/setuptools/tests/fixtures.py @@ -1,4 +1,3 @@ -import pathlib import shutil import pytest @@ -27,13 +26,7 @@ def tmpdir_cwd(tmpdir): @pytest.fixture -def src_dir(): - """The project source directory available via fixture.""" - return pathlib.Path(__file__).parents[2] - - -@pytest.fixture -def tmp_src(src_dir, tmp_path): +def tmp_src(request, tmp_path): """Make a copy of the source dir under `$tmp/src`. This fixture is useful whenever it's necessary to run `setup.py` @@ -44,5 +37,5 @@ def tmp_src(src_dir, tmp_path): when they are not being executed sequentially. """ tmp_src_path = tmp_path / 'src' - shutil.copytree(src_dir, tmp_src_path) + shutil.copytree(request.config.rootdir, tmp_src_path) return tmp_src_path |
