File tree Expand file tree Collapse file tree 5 files changed +26
-40
lines changed Expand file tree Collapse file tree 5 files changed +26
-40
lines changed Original file line number Diff line number Diff line change 11[run]
22branch = True
3- data_file = .coverage
4- source = .
5- omit =
6- nipype/external/*
7- nipype/fixes/*
8- tools/*
9- doc/*
10- */tests/*
11- include =
12- tools/run_examples.py
13-
14- [report]
15- exclude_lines =
16- # Have to re-enable the standard pragma
17- pragma: no cover
18-
19- # Don't complain about missing debug-only code:
20- def __repr__
21- if self\.debug
22-
23- # Don't complain if tests don't hit defensive assertion code:
24- raise AssertionError
25- raise NotImplementedError
26-
27- # Don't complain if non-runnable code isn't run:
28- if 0:
29- if __name__ == .__main__.:
Original file line number Diff line number Diff line change @@ -17,17 +17,16 @@ echo "log_to_file = true" >> ${HOME}/.nipype/nipype.cfg
1717echo " log_directory = ${WORKDIR} /logs/example_${example_id} " >> ${HOME} /.nipype/nipype.cfg
1818
1919# Set up coverage
20- export COVERAGE_PROCESS_START=/src/nipype/.coveragerc
21- sed -i -E " s/(source = ).*'/\1\/src\/nipype\/nipype/" /src/nipype/.coveragerc
22- sed -i -E " s/(data_file = ).*'/\1\/\/work\/.coverage/" /src/nipype/.coveragerc
20+ export COVERAGE_FILE=${WORKDIR} /.coverage_${example_id}
21+ # sed -i -E "s/(source = ).*'/\1\/src\/nipype\/nipype/" /src/nipype/.coveragerc
2322
2423if [ " $2 " == " MultiProc" ]; then
2524 echo " concurrency = multiprocessing" >> /src/nipype/.coveragerc
2625fi
2726
28- coverage run --rcfile=/src/nipype/.coveragerc /src/nipype/tools/run_examples.py $@
27+ coverage run /src/nipype/tools/run_examples.py $@
2928exit_code=$?
3029
31- coverage xml --rcfile=/src/nipype/.coveragerc - o ${WORKDIR} /smoketest_${example_id} .xml || true
30+ coverage xml -o ${WORKDIR} /smoketest_${example_id} .xml || true
3231
3332exit $exit_code
Original file line number Diff line number Diff line change 33set -x
44set -u
55
6+
7+ TESTPATH=${1:-/ src/ nipype/ }
68WORKDIR=${WORK:-/ work}
79PYTHON_VERSION=$( python -c " import sys; print('{}{}'.format(sys.version_info[0], sys.version_info[1]))" )
810
@@ -22,15 +24,16 @@ if [[ "${PYTHON_VERSION}" -lt "30" ]]; then
2224fi
2325
2426# Run tests using pytest
25- py.test -n ${CIRCLE_NCPUS:- 1} -v --junitxml=${WORKDIR} /pytests_py${PYTHON_VERSION} .xml --cov-config /src/nipype/.coveragerc --cov-report xml:${WORKDIR} /coverage_py${PYTHON_VERSION} .xml /src/nipype/
27+ export COVERAGE_FILE=${WORKDIR} /.coverage_py${PYTHON_VERSION}
28+ py.test -v --junitxml=${WORKDIR} /pytests_py${PYTHON_VERSION} .xml --cov nipype --cov-config /src/nipype/.coveragerc --cov-report xml:${WORKDIR} /coverage_py${PYTHON_VERSION} .xml ${TESTPATH}
2629exit_code=$?
2730
2831# Workaround: run here the profiler tests in python 3
2932if [[ " ${PYTHON_VERSION} " -ge " 30" ]]; then
3033 echo ' [execution]' >> ${HOME} /.nipype/nipype.cfg
3134 echo ' profile_runtime = true' >> ${HOME} /.nipype/nipype.cfg
32- py.test -n ${CIRCLE_NCPUS :- 1} -v --junitxml =${WORKDIR} /pytests_py ${PYTHON_VERSION} _profiler.xml --cov-report xml: ${WORKDIR} / coverage_py${PYTHON_VERSION} _profiler.xml /src/nipype/nipype/interfaces/tests/test_runtime_profiler.py && \
33- py.test -n ${CIRCLE_NCPUS :- 1} - v --junitxml=${WORKDIR} /pytests_py${PYTHON_VERSION} _multiproc .xml --cov- report xml:${WORKDIR} /coverage_py${PYTHON_VERSION} _multiproc .xml /src/nipype/nipype/pipeline/plugins/tests/test_multiproc* .py
35+ export COVERAGE_FILE =${WORKDIR} /. coverage_py${PYTHON_VERSION} _extra
36+ py.test -v --junitxml=${WORKDIR} /pytests_py${PYTHON_VERSION} _extra .xml --cov nipype --cov- report xml:${WORKDIR} /coverage_py${PYTHON_VERSION} _extra .xml /src/nipype/nipype/interfaces/tests/test_runtime_profiler.py /src/nipype/nipype/pipeline/plugins/tests/test_multiproc* .py
3437 exit_code=$(( $exit_code + $? ))
3538fi
3639
Original file line number Diff line number Diff line change @@ -144,7 +144,6 @@ def get_nipype_gitversion():
144144TESTS_REQUIRES = [
145145 'pytest>=%s' % PYTEST_MIN_VERSION ,
146146 'pytest-cov' ,
147- 'pytest-xdist' ,
148147 'mock' ,
149148 'codecov' ,
150149 'dipy' ,
Original file line number Diff line number Diff line change 1111from io import StringIO
1212from ...utils import nipype_cmd
1313
14- PY3 = sys .version_info [0 ] >= 3
14+ PY2 = sys .version_info [0 ] < 3
1515
1616@contextmanager
1717def capture_sys_output ():
@@ -34,10 +34,17 @@ def test_main_returns_2_on_empty(self):
3434
3535 exit_exception = cm .value
3636 assert exit_exception .code == 2
37- assert stderr .getvalue () == \
38- """usage: nipype_cmd [-h] module interface
37+
38+ msg = """usage: nipype_cmd [-h] module interface
39+ nipype_cmd: error: the following arguments are required: module, interface
40+ """
41+
42+ if PY2 :
43+ msg = """usage: nipype_cmd [-h] module interface
3944nipype_cmd: error: too few arguments
4045"""
46+ assert stderr .getvalue () == msg
47+ assert stdout .getvalue () == ''
4148
4249 def test_main_returns_0_on_help (self ):
4350 with pytest .raises (SystemExit ) as cm :
@@ -105,7 +112,12 @@ def test_run_4d_realign_without_arguments(self):
105112 in_file [in_file ...]
106113 tr"""
107114
108- error_message += """
115+ if not PY2 :
116+ error_message += """
117+ nipype_cmd nipype.interfaces.nipy FmriRealign4d: error: the following arguments are required: in_file, tr
118+ """
119+ else :
120+ error_message += """
109121nipype_cmd nipype.interfaces.nipy FmriRealign4d: error: too few arguments
110122"""
111123
You can’t perform that action at this time.
0 commit comments