Skip to content

Commit

Permalink
dedicated test
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Jan 25, 2023
1 parent a673186 commit 4523ba3
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions setuptools/tests/test_build_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,22 +194,6 @@ def run():
print('hello')
""")
},
{ # setup.py that relies on __file__ being an absolute path
'setup.py': DALS("""
import os
assert os.path.isabs(__file__)
__import__('setuptools').setup(
name='foo',
version='0.0.0',
py_modules=['hello'],
setup_requires=['six'],
)
"""),
'hello.py': DALS("""
def run():
print('hello')
"""),
},
]


Expand Down Expand Up @@ -836,6 +820,24 @@ def test_sys_argv_passthrough(self, tmpdir_cwd):
with pytest.raises(AssertionError):
build_backend.build_sdist("temp")

_setup_py_file_abspath = {
'setup.py': DALS("""
import os
assert os.path.isabs(__file__)
__import__('setuptools').setup(
name='foo',
version='0.0.0',
py_modules=['hello'],
setup_requires=['six'],
)
""")
}

def test_setup_py_file_abspath(self, tmpdir_cwd):
path.build(self._setup_py_file_abspath)
build_backend = self.get_build_backend()
build_backend.build_sdist("temp")

@pytest.mark.parametrize('build_hook', ('build_sdist', 'build_wheel'))
def test_build_with_empty_setuppy(self, build_backend, build_hook):
files = {'setup.py': ''}
Expand Down

0 comments on commit 4523ba3

Please sign in to comment.