Commit b05a6c5e authored by xoviat's avatar xoviat Committed by GitHub

TST: add more for build_meta

parent 55e1b97a
...@@ -42,22 +42,55 @@ class BuildBackendCaller(BuildBackendBase): ...@@ -42,22 +42,55 @@ class BuildBackendCaller(BuildBackendBase):
return getattr(mod, name)(*args, **kw) return getattr(mod, name)(*args, **kw)
@pytest.fixture defns = [{
def build_backend(tmpdir): 'setup.py': DALS("""
defn = { __import__('setuptools').setup(
'setup.py': DALS(""" name='foo',
__import__('setuptools').setup( py_modules=['hello'],
name='foo', setup_requires=['six'],
py_modules=['hello'], )
setup_requires=['six'], """),
) 'hello.py': DALS("""
"""), def run():
'hello.py': DALS(""" print('hello')
def run(): """),
print('hello') },
"""), {
} 'setup.py': DALS("""
build_files(defn, prefix=str(tmpdir)) 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(): with tmpdir.as_cwd():
yield BuildBackend(cwd='.') yield BuildBackend(cwd='.')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment