aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-01-14 18:43:48 -0500
committerJason R. Coombs <jaraco@jaraco.com>2020-01-14 18:43:48 -0500
commitb5022cdbf60e1ba072af3af83c79df657272c56d (patch)
treeecd6bd6e623b9d75d866c8e310dbbd51f67630a7 /setuptools/tests
parentd1bf0d2a92350b6dea783821868cc93aba17b813 (diff)
parentb2701fb39252fc68b4f0b22c3a3b79039f4cc58e (diff)
downloadexternal_python_setuptools-b5022cdbf60e1ba072af3af83c79df657272c56d.tar.gz
external_python_setuptools-b5022cdbf60e1ba072af3af83c79df657272c56d.tar.bz2
external_python_setuptools-b5022cdbf60e1ba072af3af83c79df657272c56d.zip
Merge branch 'sys_argv' of https://github.com/aimileus/setuptools into maint/44.x
Diffstat (limited to 'setuptools/tests')
-rw-r--r--setuptools/tests/test_build_meta.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/setuptools/tests/test_build_meta.py b/setuptools/tests/test_build_meta.py
index 326b4f5d..d68444f6 100644
--- a/setuptools/tests/test_build_meta.py
+++ b/setuptools/tests/test_build_meta.py
@@ -406,6 +406,28 @@ class TestBuildMetaBackend:
assert expected == sorted(actual)
+ _sys_argv_0_passthrough = {
+ 'setup.py': DALS("""
+ import os
+ import sys
+
+ __import__('setuptools').setup(
+ name='foo',
+ version='0.0.0',
+ )
+
+ sys_argv = os.path.abspath(sys.argv[0])
+ file_path = os.path.abspath('setup.py')
+ assert sys_argv == file_path
+ """)
+ }
+
+ def test_sys_argv_passthrough(self, tmpdir_cwd):
+ build_files(self._sys_argv_0_passthrough)
+ build_backend = self.get_build_backend()
+ with pytest.raises(AssertionError):
+ build_backend.build_sdist("temp")
+
class TestBuildMetaLegacyBackend(TestBuildMetaBackend):
backend_name = 'setuptools.build_meta:__legacy__'
@@ -417,3 +439,9 @@ class TestBuildMetaLegacyBackend(TestBuildMetaBackend):
build_backend = self.get_build_backend()
build_backend.build_sdist("temp")
+
+ def test_sys_argv_passthrough(self, tmpdir_cwd):
+ build_files(self._sys_argv_0_passthrough)
+
+ build_backend = self.get_build_backend()
+ build_backend.build_sdist("temp")