File tree 5 files changed +26
-40
lines changed
5 files changed +26
-40
lines changed Original file line number Diff line number Diff line change 1
1
[run]
2
2
branch = 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
17
17
echo " log_directory = ${WORKDIR} /logs/example_${example_id} " >> ${HOME} /.nipype/nipype.cfg
18
18
19
19
# 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
23
22
24
23
if [ " $2 " == " MultiProc" ]; then
25
24
echo " concurrency = multiprocessing" >> /src/nipype/.coveragerc
26
25
fi
27
26
28
- coverage run --rcfile=/src/nipype/.coveragerc /src/nipype/tools/run_examples.py $@
27
+ coverage run /src/nipype/tools/run_examples.py $@
29
28
exit_code=$?
30
29
31
- coverage xml --rcfile=/src/nipype/.coveragerc - o ${WORKDIR} /smoketest_${example_id} .xml || true
30
+ coverage xml -o ${WORKDIR} /smoketest_${example_id} .xml || true
32
31
33
32
exit $exit_code
Original file line number Diff line number Diff line change 3
3
set -x
4
4
set -u
5
5
6
+
7
+ TESTPATH=${1:-/ src/ nipype/ }
6
8
WORKDIR=${WORK:-/ work}
7
9
PYTHON_VERSION=$( python -c " import sys; print('{}{}'.format(sys.version_info[0], sys.version_info[1]))" )
8
10
@@ -22,15 +24,16 @@ if [[ "${PYTHON_VERSION}" -lt "30" ]]; then
22
24
fi
23
25
24
26
# 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}
26
29
exit_code=$?
27
30
28
31
# Workaround: run here the profiler tests in python 3
29
32
if [[ " ${PYTHON_VERSION} " -ge " 30" ]]; then
30
33
echo ' [execution]' >> ${HOME} /.nipype/nipype.cfg
31
34
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
34
37
exit_code=$(( $exit_code + $? ))
35
38
fi
36
39
Original file line number Diff line number Diff line change @@ -144,7 +144,6 @@ def get_nipype_gitversion():
144
144
TESTS_REQUIRES = [
145
145
'pytest>=%s' % PYTEST_MIN_VERSION ,
146
146
'pytest-cov' ,
147
- 'pytest-xdist' ,
148
147
'mock' ,
149
148
'codecov' ,
150
149
'dipy' ,
Original file line number Diff line number Diff line change 11
11
from io import StringIO
12
12
from ...utils import nipype_cmd
13
13
14
- PY3 = sys .version_info [0 ] >= 3
14
+ PY2 = sys .version_info [0 ] < 3
15
15
16
16
@contextmanager
17
17
def capture_sys_output ():
@@ -34,10 +34,17 @@ def test_main_returns_2_on_empty(self):
34
34
35
35
exit_exception = cm .value
36
36
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
39
44
nipype_cmd: error: too few arguments
40
45
"""
46
+ assert stderr .getvalue () == msg
47
+ assert stdout .getvalue () == ''
41
48
42
49
def test_main_returns_0_on_help (self ):
43
50
with pytest .raises (SystemExit ) as cm :
@@ -105,7 +112,12 @@ def test_run_4d_realign_without_arguments(self):
105
112
in_file [in_file ...]
106
113
tr"""
107
114
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 += """
109
121
nipype_cmd nipype.interfaces.nipy FmriRealign4d: error: too few arguments
110
122
"""
111
123
You can’t perform that action at this time.
0 commit comments