Files
cibuildwheel/test/test_unicode.py
T

33 lines
810 B
Python
Raw Normal View History

2020-05-25 14:55:04 +02:00
import textwrap
import pytest
2021-01-06 13:50:58 -05:00
from . import test_projects, utils
2020-05-25 14:55:04 +02:00
project_with_unicode = test_projects.new_c_project(
2021-04-30 17:56:34 -04:00
spam_c_function_add=textwrap.dedent(
r'''
2020-05-25 14:55:04 +02:00
{
Py_XDECREF(PyUnicode_FromStringAndSize("foo", 4));
}
2021-04-30 17:56:34 -04:00
'''
),
2020-05-25 14:55:04 +02:00
)
def test(tmp_path):
if utils.platform != 'linux':
pytest.skip('the docker test is only relevant to the linux build')
project_dir = tmp_path / 'project'
project_with_unicode.generate(project_dir)
# build the wheels
2021-04-30 17:56:34 -04:00
actual_wheels = utils.cibuildwheel_run(
project_dir, add_env={'CIBW_TEST_COMMAND': 'python -c "import spam"'}
)
2020-05-25 14:55:04 +02:00
# check that the expected wheels are produced
expected_wheels = utils.expected_wheels('spam', '0.1.0')
assert set(actual_wheels) == set(expected_wheels)