From 4f4fed06e0228819960ab4915af151764861d3f0 Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Sat, 7 Sep 2019 17:38:31 +0100 Subject: [PATCH] Added unit test for CIBW_TEST_EXTRAS --- test/02_test/cibuildwheel_test.py | 20 +++++++++++++++++++- test/02_test/setup.py | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/test/02_test/cibuildwheel_test.py b/test/02_test/cibuildwheel_test.py index aa1de0fd..54973573 100644 --- a/test/02_test/cibuildwheel_test.py +++ b/test/02_test/cibuildwheel_test.py @@ -12,7 +12,25 @@ def test(): 'CIBW_TEST_COMMAND': 'false || nosetests {project}/test', 'CIBW_TEST_COMMAND_WINDOWS': 'nosetests {project}/test', }) - + + # also check that we got the right wheels + expected_wheels = utils.expected_wheels('spam', '0.1.0') + actual_wheels = os.listdir('wheelhouse') + assert set(actual_wheels) == set(expected_wheels) + + +def test_extras_require(): + project_dir = os.path.dirname(__file__) + + # build and test the 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': 'nosetests {project}/test', + }) + # also check that we got the right wheels expected_wheels = utils.expected_wheels('spam', '0.1.0') actual_wheels = os.listdir('wheelhouse') diff --git a/test/02_test/setup.py b/test/02_test/setup.py index 866fa22c..1609aad6 100644 --- a/test/02_test/setup.py +++ b/test/02_test/setup.py @@ -3,5 +3,6 @@ from setuptools import setup, Extension setup( name="spam", ext_modules=[Extension('spam', sources=['spam.c'])], + extras_require={'test': ['nose']}, version="0.1.0", )