24 lines
805 B
Python
24 lines
805 B
Python
import os
|
|
|
|
import utils
|
|
|
|
|
|
def test():
|
|
project_dir = os.path.dirname(__file__)
|
|
|
|
with open(os.path.join(project_dir, "text_info.txt"), mode='w') as ff:
|
|
print("dummy text", file=ff)
|
|
|
|
# build the wheels
|
|
actual_wheels = utils.cibuildwheel_run(project_dir, add_env={
|
|
# write python version information to a temporary file, this is
|
|
# checked in setup.py
|
|
'CIBW_BEFORE_ALL': '''python -c "import os;open('{project}/text_info.txt', 'w').write('sample text '+os.environ.get('TEST_VAL', ''))"''',
|
|
'CIBW_ENVIRONMENT': "TEST_VAL='123'"
|
|
})
|
|
|
|
# also check that we got the right wheels
|
|
os.remove(os.path.join(project_dir, "text_info.txt"))
|
|
expected_wheels = utils.expected_wheels('spam', '0.1.0')
|
|
assert set(actual_wheels) == set(expected_wheels)
|