style: apply black via pre-commit run -a

This commit is contained in:
Henry Schreiner
2021-05-03 13:12:36 -04:00
committed by Henry Schreiner
parent 9cbed6a9be
commit 178aaea6c7
53 changed files with 1479 additions and 714 deletions
+42 -26
View File
@@ -7,13 +7,17 @@ import pytest
from . import test_projects, utils
project_with_a_test = test_projects.new_c_project(
setup_cfg_add=textwrap.dedent(r'''
setup_cfg_add=textwrap.dedent(
r'''
[options.extras_require]
test = nose
''')
'''
)
)
project_with_a_test.files['test/spam_test.py'] = r'''
project_with_a_test.files[
'test/spam_test.py'
] = r'''
import os
import platform
import sys
@@ -75,13 +79,16 @@ def test(tmp_path):
project_with_a_test.generate(project_dir)
# build and test the wheels
actual_wheels = utils.cibuildwheel_run(project_dir, add_env={
'CIBW_TEST_REQUIRES': 'nose',
# the 'false ||' bit is to ensure this command runs in a shell on
# mac/linux.
'CIBW_TEST_COMMAND': 'false || nosetests {project}/test',
'CIBW_TEST_COMMAND_WINDOWS': 'COLOR 00 || nosetests {project}/test',
})
actual_wheels = utils.cibuildwheel_run(
project_dir,
add_env={
'CIBW_TEST_REQUIRES': 'nose',
# the 'false ||' bit is to ensure this command runs in a shell on
# mac/linux.
'CIBW_TEST_COMMAND': 'false || nosetests {project}/test',
'CIBW_TEST_COMMAND_WINDOWS': 'COLOR 00 || nosetests {project}/test',
},
)
# also check that we got the right wheels
expected_wheels = utils.expected_wheels('spam', '0.1.0')
@@ -93,13 +100,16 @@ def test_extras_require(tmp_path):
project_with_a_test.generate(project_dir)
# build and test the wheels
actual_wheels = utils.cibuildwheel_run(project_dir, add_env={
'CIBW_TEST_EXTRAS': 'test',
# the 'false ||' bit is to ensure this command runs in a shell on
# mac/linux.
'CIBW_TEST_COMMAND': 'false || nosetests {project}/test',
'CIBW_TEST_COMMAND_WINDOWS': 'COLOR 00 || nosetests {project}/test',
})
actual_wheels = utils.cibuildwheel_run(
project_dir,
add_env={
'CIBW_TEST_EXTRAS': 'test',
# the 'false ||' bit is to ensure this command runs in a shell on
# mac/linux.
'CIBW_TEST_COMMAND': 'false || nosetests {project}/test',
'CIBW_TEST_COMMAND_WINDOWS': 'COLOR 00 || nosetests {project}/test',
},
)
# also check that we got the right wheels
expected_wheels = utils.expected_wheels('spam', '0.1.0')
@@ -107,7 +117,9 @@ def test_extras_require(tmp_path):
project_with_a_failing_test = test_projects.new_c_project()
project_with_a_failing_test.files['test/spam_test.py'] = r'''
project_with_a_failing_test.files[
'test/spam_test.py'
] = r'''
from unittest import TestCase
class TestSpam(TestCase):
@@ -123,13 +135,17 @@ def test_failing_test(tmp_path):
project_with_a_failing_test.generate(project_dir)
with pytest.raises(subprocess.CalledProcessError):
utils.cibuildwheel_run(project_dir, output_dir=output_dir, add_env={
'CIBW_TEST_REQUIRES': 'nose',
'CIBW_TEST_COMMAND': 'nosetests {project}/test',
# manylinux1 has a version of bash that's been shown to have
# problems with this, so let's check that.
'CIBW_MANYLINUX_I686_IMAGE': 'manylinux1',
'CIBW_MANYLINUX_X86_64_IMAGE': 'manylinux1',
})
utils.cibuildwheel_run(
project_dir,
output_dir=output_dir,
add_env={
'CIBW_TEST_REQUIRES': 'nose',
'CIBW_TEST_COMMAND': 'nosetests {project}/test',
# manylinux1 has a version of bash that's been shown to have
# problems with this, so let's check that.
'CIBW_MANYLINUX_I686_IMAGE': 'manylinux1',
'CIBW_MANYLINUX_X86_64_IMAGE': 'manylinux1',
},
)
assert len(os.listdir(output_dir)) == 0