diff options
| author | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2021-12-24 18:54:11 +0000 |
|---|---|---|
| committer | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2022-01-06 22:48:43 +0000 |
| commit | dde9015db6a6e8b25e6a2df52a6859ddcedcd5b0 (patch) | |
| tree | b860d4fe818f5c1b36e0390c4df5288487062953 | |
| parent | 34e0fcbc8886b1940cfaeaf8c9de1b6f1cc199d7 (diff) | |
| download | python-setuptools-git-dde9015db6a6e8b25e6a2df52a6859ddcedcd5b0.tar.gz | |
Prevent some tests from inadvertently using the project root for builds
Some tests are running the build process using setuptools own directory
as cwd. This impacts the build process and also leave behind artifacts
produced during tests (like .egg-info folders)
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | setuptools/tests/test_bdist_deprecations.py | 2 | ||||
| -rw-r--r-- | setuptools/tests/test_setuptools.py | 5 |
3 files changed, 6 insertions, 2 deletions
@@ -6,7 +6,6 @@ docs/build include lib distribute.egg-info -foo.egg-info setuptools.egg-info .coverage .eggs diff --git a/setuptools/tests/test_bdist_deprecations.py b/setuptools/tests/test_bdist_deprecations.py index 28482fd0..1a900c67 100644 --- a/setuptools/tests/test_bdist_deprecations.py +++ b/setuptools/tests/test_bdist_deprecations.py @@ -11,7 +11,7 @@ from setuptools import SetuptoolsDeprecationWarning @pytest.mark.skipif(sys.platform == 'win32', reason='non-Windows only') @mock.patch('distutils.command.bdist_rpm.bdist_rpm') -def test_bdist_rpm_warning(distutils_cmd): +def test_bdist_rpm_warning(distutils_cmd, tmpdir_cwd): dist = Distribution( dict( script_name='setup.py', diff --git a/setuptools/tests/test_setuptools.py b/setuptools/tests/test_setuptools.py index 3609ab5e..3c429263 100644 --- a/setuptools/tests/test_setuptools.py +++ b/setuptools/tests/test_setuptools.py @@ -18,6 +18,11 @@ import setuptools.depends as dep from setuptools.depends import Require +@pytest.fixture(autouse=True) +def isolated_dir(tmpdir_cwd): + yield + + def makeSetup(**args): """Return distribution from 'setup(**args)', without executing commands""" |
