diff options
author | xoviat <xoviat@users.noreply.github.com> | 2017-10-16 10:57:10 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-16 10:57:10 -0500 |
commit | b05a6c5e42d85ee463e5c718ceb49f19b609beba (patch) | |
tree | 9f450669cbe60e5d1fd7b6647c2eac0144840c63 /setuptools/tests/test_build_meta.py | |
parent | 55e1b97a8a06956d60f7e441ebe46200efc775df (diff) | |
download | external_python_setuptools-b05a6c5e42d85ee463e5c718ceb49f19b609beba.tar.gz external_python_setuptools-b05a6c5e42d85ee463e5c718ceb49f19b609beba.tar.bz2 external_python_setuptools-b05a6c5e42d85ee463e5c718ceb49f19b609beba.zip |
TST: add more for build_meta
Diffstat (limited to 'setuptools/tests/test_build_meta.py')
-rw-r--r-- | setuptools/tests/test_build_meta.py | 65 |
1 files changed, 49 insertions, 16 deletions
diff --git a/setuptools/tests/test_build_meta.py b/setuptools/tests/test_build_meta.py index 69a700c2..2516b702 100644 --- a/setuptools/tests/test_build_meta.py +++ b/setuptools/tests/test_build_meta.py @@ -42,22 +42,55 @@ class BuildBackendCaller(BuildBackendBase): return getattr(mod, name)(*args, **kw) -@pytest.fixture -def build_backend(tmpdir): - defn = { - 'setup.py': DALS(""" - __import__('setuptools').setup( - name='foo', - py_modules=['hello'], - setup_requires=['six'], - ) - """), - 'hello.py': DALS(""" - def run(): - print('hello') - """), - } - build_files(defn, prefix=str(tmpdir)) +defns = [{ + 'setup.py': DALS(""" + __import__('setuptools').setup( + name='foo', + py_modules=['hello'], + setup_requires=['six'], + ) + """), + 'hello.py': DALS(""" + def run(): + print('hello') + """), + }, + { + 'setup.py': DALS(""" + assert __name__ == '__main__' + __import__('setuptools').setup( + name='foo', + py_modules=['hello'], + setup_requires=['six'], + ) + """), + 'hello.py': DALS(""" + def run(): + print('hello') + """), + }, + { + 'setup.py': DALS(""" + variable = True + def function(): + return variable + assert variable + __import__('setuptools').setup( + name='foo', + py_modules=['hello'], + setup_requires=['six'], + ) + """), + 'hello.py': DALS(""" + def run(): + print('hello') + """), + }] + + +@pytest.fixture(scope="module", params=defns) +def build_backend(tmpdir, request): + build_files(request.param, prefix=str(tmpdir)) with tmpdir.as_cwd(): yield BuildBackend(cwd='.') |