Skip to content

Commit 1fd6b76

Browse files
committed
Merge remote-tracking branch 'dorota/pytest_satrarev' into fix/bunchmapnode
* dorota/pytest_satrarev: it looks like codecov works at the end, removing COVERAGE_PROCESS_START and COVERAGE_DATA_FILE from travis again trying to fix coverage (codecov doesnt report anything), restoring some lines from travis removing workflows from the directories that are omitted restore get_info in nipype/__init__.py Removing nosetest from nipype/__init__.py; pytest version is missing for now fixing the travis file removing coverage from travis (so the coverage is calculated from Circle CI only) removing fixes removing scripts from tools directory that are not used anymore changing test_auto_TCompCor.py to the output of checkspecs.py adding the auto test for ACompCor changing a simple assert to np.isclose in test_icc_anova cleaning:removing pdb restring one skipif in interfaces/tests/test_io.py removing one test from interfaces/tests/test_base.py; it was repeating the same assert as the previous one fixing one assert in test_math restoring 2 tests that had only import statement, changing comments
2 parents 45b5692 + a3cf60d commit 1fd6b76

22 files changed

+94
-1025
lines changed

.coveragerc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ source = nipype
44
include = */nipype/*
55
omit =
66
*/nipype/external/*
7-
*/nipype/workflows/*
87
*/nipype/fixes/*
98
*/setup.py

.travis.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,10 @@ install:
3636
conda install -y nipype &&
3737
rm -r /home/travis/miniconda/lib/python${TRAVIS_PYTHON_VERSION}/site-packages/nipype* &&
3838
pip install -r requirements.txt &&
39-
pip install -e .[$NIPYPE_EXTRAS] &&
40-
export COVERAGE_PROCESS_START=$(pwd)/.coveragerc &&
41-
export COVERAGE_DATA_FILE=$(pwd)/.coverage &&
42-
echo "data_file = ${COVERAGE_DATA_FILE}" >> ${COVERAGE_PROCESS_START}; }
39+
pip install -e .[$NIPYPE_EXTRAS]; }
4340
- travis_retry inst
4441
script:
45-
- py.test --doctest-modules --cov=nipype nipype
46-
after_success:
47-
- bash <(curl -s https://codecov.io/bash) -t ac172a50-8e66-42e5-8822-5373fcf54686 -cF unittests
42+
- py.test --doctest-modules nipype
4843
deploy:
4944
provider: pypi
5045
user: satra

nipype/__init__.py

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
STATUS as __status__,
1212
__version__)
1313
from .utils.config import NipypeConfig
14-
from .fixes.numpy.testing import nosetester
1514
from .utils.logger import Logging
1615
from .refs import due
1716

@@ -24,48 +23,48 @@
2423
config = NipypeConfig()
2524
logging = Logging(config)
2625

26+
#NOTE_dj: it has to be changed to python
27+
#class _NoseTester(nosetester.NoseTester):
28+
# """ Subclass numpy's NoseTester to add doctests by default
29+
# """
2730

28-
class _NoseTester(nosetester.NoseTester):
29-
""" Subclass numpy's NoseTester to add doctests by default
30-
"""
31+
# def _get_custom_doctester(self):
32+
# return None
3133

32-
def _get_custom_doctester(self):
33-
return None
34+
# def test(self, label='fast', verbose=1, extra_argv=['--exe'],
35+
# doctests=True, coverage=False):
36+
# """Run the full test suite
37+
#
38+
# Examples
39+
# --------
40+
# This will run the test suite and stop at the first failing
41+
# example
42+
# >>> from nipype import test
43+
# >>> test(extra_argv=['--exe', '-sx']) # doctest: +SKIP
44+
# """
45+
# return super(_NoseTester, self).test(label=label,
46+
# verbose=verbose,
47+
# extra_argv=extra_argv,
48+
# doctests=doctests,
49+
# coverage=coverage)
3450

35-
def test(self, label='fast', verbose=1, extra_argv=['--exe'],
36-
doctests=True, coverage=False):
37-
"""Run the full test suite
38-
39-
Examples
40-
--------
41-
This will run the test suite and stop at the first failing
42-
example
43-
>>> from nipype import test
44-
>>> test(extra_argv=['--exe', '-sx']) # doctest: +SKIP
45-
"""
46-
return super(_NoseTester, self).test(label=label,
47-
verbose=verbose,
48-
extra_argv=extra_argv,
49-
doctests=doctests,
50-
coverage=coverage)
51-
52-
try:
53-
test = _NoseTester(raise_warnings="release").test
54-
except TypeError:
51+
#try:
52+
# test = _NoseTester(raise_warnings="release").test
53+
#except TypeError:
5554
# Older versions of numpy do not have a raise_warnings argument
56-
test = _NoseTester().test
57-
del nosetester
55+
# test = _NoseTester().test
56+
#del nosetester
5857

5958
# Set up package information function
6059
from .pkg_info import get_pkg_info as _get_pkg_info
6160
get_info = lambda: _get_pkg_info(os.path.dirname(__file__))
6261

6362
# If this file is exec after being imported, the following lines will
6463
# fail
65-
try:
66-
del Tester
67-
except:
68-
pass
64+
#try:
65+
# del Tester
66+
#except:
67+
# pass
6968

7069

7170
from .pipeline import Node, MapNode, JoinNode, Workflow
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
2+
from ..confounds import ACompCor
3+
4+
5+
def test_ACompCor_inputs():
6+
input_map = dict(components_file=dict(usedefault=True,
7+
),
8+
header=dict(),
9+
ignore_exception=dict(nohash=True,
10+
usedefault=True,
11+
),
12+
mask_file=dict(),
13+
num_components=dict(usedefault=True,
14+
),
15+
realigned_file=dict(mandatory=True,
16+
),
17+
regress_poly_degree=dict(usedefault=True,
18+
),
19+
use_regress_poly=dict(usedefault=True,
20+
),
21+
)
22+
inputs = ACompCor.input_spec()
23+
24+
for key, metadata in list(input_map.items()):
25+
for metakey, value in list(metadata.items()):
26+
assert getattr(inputs.traits()[key], metakey) == value
27+
28+
29+
def test_ACompCor_outputs():
30+
output_map = dict(components_file=dict(),
31+
)
32+
outputs = ACompCor.output_spec()
33+
34+
for key, metadata in list(output_map.items()):
35+
for metakey, value in list(metadata.items()):
36+
assert getattr(outputs.traits()[key], metakey) == value

nipype/algorithms/tests/test_auto_TCompCor.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,22 @@ def test_TCompCor_inputs():
2929

3030

3131
def test_TCompCor_outputs():
32-
output_map = dict(components_file=dict(),
33-
high_variance_mask=dict()
32+
output_map = dict(components_file=dict(usedefault=True,
33+
),
34+
header=dict(),
35+
high_variance_mask=dict(),
36+
ignore_exception=dict(nohash=True,
37+
usedefault=True,
38+
),
39+
mask_file=dict(),
40+
num_components=dict(usedefault=True,
41+
),
42+
realigned_file=dict(mandatory=True,
43+
),
44+
regress_poly_degree=dict(usedefault=True,
45+
),
46+
use_regress_poly=dict(usedefault=True,
47+
),
3448
)
3549
outputs = TCompCor.output_spec()
3650

nipype/algorithms/tests/test_icc_anova.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ def test_ICC_rep_anova():
1919
assert round(icc, 2) == 0.71
2020
assert dfc == 3
2121
assert dfe == 15
22-
assert r_var / (r_var + e_var) == icc
22+
assert np.isclose(r_var / (r_var + e_var), icc)

nipype/fixes/README.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

nipype/fixes/__init__.py

Lines changed: 0 additions & 26 deletions
This file was deleted.

nipype/fixes/numpy/__init__.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

nipype/fixes/numpy/testing/__init__.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)