aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests
diff options
context:
space:
mode:
authorPaul Ganssle <paul@ganssle.io>2019-01-27 12:24:15 -0500
committerPaul Ganssle <paul@ganssle.io>2019-02-03 12:25:05 -0500
commitbd800f4c793fdcff2347a263c39c4256107b417f (patch)
treea826ec3da7e841f42f4f185e5d8b5d3d98d2e60c /setuptools/tests
parent6d0daf14277223da4e32093c00157ae5b26d1ece (diff)
downloadexternal_python_setuptools-bd800f4c793fdcff2347a263c39c4256107b417f.tar.gz
external_python_setuptools-bd800f4c793fdcff2347a263c39c4256107b417f.tar.bz2
external_python_setuptools-bd800f4c793fdcff2347a263c39c4256107b417f.zip
Add test for relative path imports in build_meta
Failing test adapted from PR #1643 Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
Diffstat (limited to 'setuptools/tests')
-rw-r--r--setuptools/tests/test_build_meta.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/setuptools/tests/test_build_meta.py b/setuptools/tests/test_build_meta.py
index a9865382..8222b8a2 100644
--- a/setuptools/tests/test_build_meta.py
+++ b/setuptools/tests/test_build_meta.py
@@ -236,3 +236,23 @@ class TestBuildMetaBackend:
build_backend = self.get_build_backend()
build_backend.build_sdist("temp")
+
+ _relative_path_import_files = {
+ 'setup.py': DALS("""
+ __import__('setuptools').setup(
+ name='foo',
+ version=__import__('hello').__version__,
+ py_modules=['hello']
+ )"""),
+ 'hello.py': '__version__ = "0.0.0"',
+ 'setup.cfg': DALS("""
+ [sdist]
+ formats=zip
+ """)
+ }
+
+ def test_build_sdist_relative_path_import(self, tmpdir_cwd):
+ build_files(self._relative_path_import_files)
+ build_backend = self.get_build_backend()
+ with pytest.raises(ImportError):
+ build_backend.build_sdist("temp")