2020-08-13 11:46:39 +01:00
|
|
|
import subprocess
|
2021-01-06 13:50:58 -05:00
|
|
|
|
2020-08-13 11:46:39 +01:00
|
|
|
import pytest
|
2021-01-06 13:50:58 -05:00
|
|
|
|
2020-08-13 11:46:39 +01:00
|
|
|
from . import utils
|
2021-01-06 13:50:58 -05:00
|
|
|
from .test_projects import TestProject
|
2020-08-13 11:46:39 +01:00
|
|
|
|
|
|
|
|
so_file_project = TestProject()
|
|
|
|
|
|
2021-05-03 11:45:43 -04:00
|
|
|
so_file_project.files["libnothing.so"] = ""
|
2020-08-13 11:46:39 +01:00
|
|
|
|
2021-04-30 17:56:34 -04:00
|
|
|
so_file_project.files[
|
2021-05-03 11:45:43 -04:00
|
|
|
"setup.py"
|
|
|
|
|
] = """
|
2020-08-13 11:46:39 +01:00
|
|
|
raise Exception('this build will fail')
|
2021-05-03 11:45:43 -04:00
|
|
|
"""
|
2020-08-13 11:46:39 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_failed_project_with_so_files(tmp_path, capfd):
|
2021-05-03 11:45:43 -04:00
|
|
|
if utils.platform != "linux":
|
|
|
|
|
pytest.skip("this test is only relevant to the linux build")
|
2020-08-13 11:46:39 +01:00
|
|
|
|
2021-05-03 11:45:43 -04:00
|
|
|
project_dir = tmp_path / "project"
|
2020-08-13 11:46:39 +01:00
|
|
|
so_file_project.generate(project_dir)
|
|
|
|
|
|
|
|
|
|
with pytest.raises(subprocess.CalledProcessError):
|
|
|
|
|
utils.cibuildwheel_run(project_dir)
|
|
|
|
|
|
|
|
|
|
captured = capfd.readouterr()
|
2021-05-03 11:45:43 -04:00
|
|
|
print("out", captured.out)
|
|
|
|
|
print("err", captured.err)
|
2020-08-13 11:46:39 +01:00
|
|
|
assert "NOTE: Shared object (.so) files found in this project." in captured.err
|