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):
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='.')
......
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