Move the pythonpath fiddling to the test runner
instead of including it in every test
This commit is contained in:
+11
-1
@@ -3,10 +3,20 @@
|
||||
from __future__ import print_function
|
||||
import os, sys, subprocess, shutil
|
||||
|
||||
project_root = os.path.dirname(os.path.dirname(__file__))
|
||||
test_utils_dir = os.path.join(project_root, 'test', 'shared')
|
||||
|
||||
def single_run(test_project):
|
||||
# set up an environment that gives access to the test utils
|
||||
env = os.environ.copy()
|
||||
env.update({
|
||||
'PYTHONPATH': test_utils_dir,
|
||||
})
|
||||
|
||||
# run the test
|
||||
subprocess.check_call(
|
||||
[sys.executable, '-m', 'pytest', '-v', os.path.join(test_project, 'cibuildwheel_test.py')]
|
||||
[sys.executable, '-m', 'pytest', '-v', os.path.join(test_project, 'cibuildwheel_test.py')],
|
||||
env=env,
|
||||
)
|
||||
|
||||
# clean up
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import subprocess, sys, os
|
||||
from glob import glob
|
||||
project_dir = os.path.dirname(__file__)
|
||||
sys.path.append(os.path.join(os.path.dirname(project_dir), 'shared'))
|
||||
|
||||
import utils
|
||||
|
||||
def test():
|
||||
project_dir = os.path.dirname(__file__)
|
||||
|
||||
# build the wheels
|
||||
subprocess.check_call([sys.executable, '-m', 'cibuildwheel', project_dir])
|
||||
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import subprocess, sys, os
|
||||
from glob import glob
|
||||
project_dir = os.path.dirname(__file__)
|
||||
sys.path.append(os.path.join(os.path.dirname(project_dir), 'shared'))
|
||||
|
||||
import utils
|
||||
|
||||
def test():
|
||||
project_dir = os.path.dirname(__file__)
|
||||
# set up the environment
|
||||
env = os.environ.copy()
|
||||
env['CIBW_TEST_REQUIRES'] = 'nose'
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
import subprocess, sys, os
|
||||
from glob import glob
|
||||
project_dir = os.path.dirname(__file__)
|
||||
sys.path.append(os.path.join(os.path.dirname(project_dir), 'shared'))
|
||||
|
||||
import utils
|
||||
|
||||
def test():
|
||||
project_dir = os.path.dirname(__file__)
|
||||
# set up the environment
|
||||
env = os.environ.copy()
|
||||
# write python version information to a temporary file, this is checked
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import subprocess, sys, os
|
||||
from glob import glob
|
||||
project_dir = os.path.dirname(__file__)
|
||||
sys.path.append(os.path.join(os.path.dirname(project_dir), 'shared'))
|
||||
|
||||
import utils
|
||||
|
||||
def test():
|
||||
project_dir = os.path.dirname(__file__)
|
||||
|
||||
# set up the environment
|
||||
env = os.environ.copy()
|
||||
env['CIBW_BUILD'] = 'cp3?-*'
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import subprocess, sys, os
|
||||
from glob import glob
|
||||
project_dir = os.path.dirname(__file__)
|
||||
sys.path.append(os.path.join(os.path.dirname(project_dir), 'shared'))
|
||||
import utils
|
||||
|
||||
def test():
|
||||
project_dir = os.path.dirname(__file__)
|
||||
|
||||
# set up the environment
|
||||
env = os.environ.copy()
|
||||
# write some information into the CIBW_ENVIRONMENT, for expansion and
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import subprocess, sys, os, pytest
|
||||
from glob import glob
|
||||
project_dir = os.path.dirname(__file__)
|
||||
sys.path.append(os.path.join(os.path.dirname(project_dir), 'shared'))
|
||||
import utils
|
||||
|
||||
def test():
|
||||
project_dir = os.path.dirname(__file__)
|
||||
if not sys.platform.startswith('linux'):
|
||||
pytest.skip('the docker test is only relevant to the linux build')
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import subprocess, sys, os
|
||||
from glob import glob
|
||||
project_dir = os.path.dirname(__file__)
|
||||
sys.path.append(os.path.join(os.path.dirname(project_dir), 'shared'))
|
||||
import utils
|
||||
|
||||
def test():
|
||||
project_dir = os.path.dirname(__file__)
|
||||
# this test checks that SSL is working in the build environment using
|
||||
# some checks in setup.py.
|
||||
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
'''
|
||||
Utility functions used by the cibuildwheel tests.
|
||||
|
||||
This file is added to the PYTHONPATH in the test runner at bin/run_test.py.
|
||||
'''
|
||||
|
||||
import subprocess, sys
|
||||
|
||||
def cibuildwheel_get_build_identifiers(project_path, env=None):
|
||||
|
||||
Reference in New Issue
Block a user