aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools
diff options
context:
space:
mode:
authorxoviat <xoviat@users.noreply.github.com>2017-09-03 21:01:21 -0500
committerxoviat <xoviat@users.noreply.github.com>2017-09-07 21:41:54 -0500
commitbfe0ee278051b5bfb17b4d716750b1f59aec4499 (patch)
tree78259597cff3f24e27dcfc903f6dbbe105a71404 /setuptools
parent06ec6304f0fbd36f9a0d1fd1ebf717352c1f5138 (diff)
downloadexternal_python_setuptools-bfe0ee278051b5bfb17b4d716750b1f59aec4499.tar.gz
external_python_setuptools-bfe0ee278051b5bfb17b4d716750b1f59aec4499.tar.bz2
external_python_setuptools-bfe0ee278051b5bfb17b4d716750b1f59aec4499.zip
pep517: implement build backend fixture
Diffstat (limited to 'setuptools')
-rw-r--r--setuptools/tests/test_pep517.py (renamed from setuptools/tests/test_pep_517.py)28
1 files changed, 28 insertions, 0 deletions
diff --git a/setuptools/tests/test_pep_517.py b/setuptools/tests/test_pep517.py
index fdc7c231..7bb460dd 100644
--- a/setuptools/tests/test_pep_517.py
+++ b/setuptools/tests/test_pep517.py
@@ -8,6 +8,10 @@ pytest.importorskip('concurrent.futures')
from importlib import import_module
from concurrent.futures import ProcessPoolExecutor
+from .files import build_files
+from .textwrap import DALS
+from . import contexts
+
class BuildBackend(object):
"""PEP 517 Build Backend"""
@@ -39,3 +43,27 @@ class BuildBackendCaller(object):
os.chdir(self.cwd)
os.environ.update(self.env)
return getattr(import_module(self.backend_name), name)
+
+
+@pytest.fixture
+def build_backend():
+ setup_script = DALS("""
+ from setuptools import setup
+
+ setup(
+ name='foo',
+ py_modules=['hello'],
+ entry_points={'console_scripts': ['hi = hello.run']},
+ zip_safe=False,
+ )
+ """)
+
+ build_files({
+ 'setup.py': setup_script,
+ 'hello.py': DALS("""
+ def run():
+ print('hello')
+ """)
+ })
+
+ return BuildBackend(cwd='.')