Skip to content

Commit 8f6c1e1

Browse files
committed
removing the comments that described my changes
1 parent f39597b commit 8f6c1e1

File tree

11 files changed

+2
-64
lines changed

11 files changed

+2
-64
lines changed

nipype/algorithms/tests/test_mesh_ops.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
from nipype.algorithms import mesh as m
1212
from ...interfaces import vtkbase as VTKInfo
1313

14-
#NOTE_dj: I moved all tests of errors reports to a new test function
15-
#NOTE_dj: some tests are empty
1614

1715
@pytest.mark.skipif(VTKInfo.no_tvtk(), reason="tvtk is not installed")
1816
def test_ident_distances(tmpdir):

nipype/interfaces/fsl/tests/test_FILMGLS.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ def test_filmgls():
4545
use_pava=dict(argstr='--pava',),
4646
)
4747
instance = FILMGLS()
48-
#NOTE_dj: don't understand this test:
49-
#NOTE_dj: IMO, it should go either to IF or ELSE, instance doesn't depend on any parameters
5048
if isinstance(instance.inputs, FILMGLSInputSpec):
5149
for key, metadata in list(input_map.items()):
5250
for metakey, value in list(metadata.items()):

nipype/interfaces/fsl/tests/test_base.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99

1010
import pytest
1111

12-
13-
#NOTE_dj: a function, e.g. "no_fsl" always gives True, shuld always change to no_fsl in pytest skipif
14-
#NOTE_dj: removed the IF statement, since skipif is used?
1512
@pytest.mark.skipif(no_fsl(), reason="fsl is not installed")
1613
def test_fslversion():
1714
ver = fsl.Info.version()
@@ -64,7 +61,7 @@ def test_FSLCommand2():
6461

6562
@pytest.mark.skipif(no_fsl(), reason="fsl is not installed")
6663
@pytest.mark.parametrize("args, desired_name",
67-
[({}, {"file": 'foo.nii.gz'}), # just the filename #NOTE_dj: changed slightly the test to meet description "just the file"
64+
[({}, {"file": 'foo.nii.gz'}), # just the filename
6865
({"suffix": '_brain'}, {"file": 'foo_brain.nii.gz'}), # filename with suffix
6966
({"suffix": '_brain', "cwd": '/data'},
7067
{"dir": '/data', "file": 'foo_brain.nii.gz'}), # filename with suffix and working directory

nipype/interfaces/fsl/tests/test_dti.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
import pytest, pdb
2121

22-
#NOTE_dj: this file contains not finished tests (search xfail) and function that are not used
2322

2423
@pytest.fixture(scope="module")
2524
def create_files_in_directory(request):
@@ -71,33 +70,6 @@ def test_dtifit2(create_files_in_directory):
7170
filelist[1])
7271

7372

74-
#NOTE_dj: setup/teardown_tbss are not used!
75-
#NOTE_dj: should be removed or will be used in the tests that are not finished?
76-
# Globals to store paths for tbss tests
77-
tbss_dir = None
78-
test_dir = None
79-
80-
81-
def setup_tbss():
82-
# Setup function is called before each test. Setup is called only
83-
# once for each generator function.
84-
global tbss_dir, tbss_files, test_dir
85-
test_dir = os.getcwd()
86-
tbss_dir = mkdtemp()
87-
os.chdir(tbss_dir)
88-
tbss_files = ['a.nii', 'b.nii']
89-
for f in tbss_files:
90-
fp = open(f, 'wt')
91-
fp.write('dummy')
92-
fp.close()
93-
94-
95-
def teardown_tbss():
96-
# Teardown is called after each test to perform cleanup
97-
os.chdir(test_dir)
98-
rmtree(tbss_dir)
99-
100-
10173
@pytest.mark.xfail(reason="These tests are skipped until we clean up some of this code")
10274
def test_randomise2():
10375

nipype/interfaces/fsl/tests/test_maths.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919

2020
import pytest
2121

22-
#NOTE_dj: i've changed a lot in the general structure of the file (not in the test themselves)
23-
#NOTE_dj: set_output_type has been changed to fixture that calls create_files_in_directory
24-
#NOTE_dj: used params within the fixture to recreate test_all_again, hope this is what the author had in mind...
2522

2623
def set_output_type(fsl_output_type):
2724
prev_output_type = os.environ.get('FSLOUTPUTTYPE', None)
@@ -37,7 +34,6 @@ def set_output_type(fsl_output_type):
3734

3835
@pytest.fixture(params=[None]+list(Info.ftypes))
3936
def create_files_in_directory(request):
40-
#NOTE_dj: removed set_output_type from test functions
4137
func_prev_type = set_output_type(request.param)
4238

4339
testdir = os.path.realpath(mkdtemp())

nipype/interfaces/fsl/tests/test_model.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import nipype.interfaces.fsl.model as fsl
1111
from nipype.interfaces.fsl import no_fsl
1212

13-
# NOTE_dj: couldn't find any reason to keep setup_file (most things were not used in the test), so i removed it
1413

1514
@pytest.mark.skipif(no_fsl(), reason="fsl is not installed")
1615
def test_MultipleRegressDesign(tmpdir):

nipype/interfaces/fsl/tests/test_preprocess.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ def fsl_name(obj, fname):
2525
return fname + ext
2626

2727

28-
#NOTE_dj: can't find reason why the global variables are needed, removed
29-
3028
@pytest.fixture()
3129
def setup_infile(request):
3230
ext = Info.output_type_to_ext(Info.output_type())
@@ -511,8 +509,6 @@ def test_applywarp(setup_flirt):
511509
settings[0])
512510
assert awarp.cmdline == realcmd
513511

514-
#NOTE_dj: removed a new definition of awarp, not sure why this was at the end of the test
515-
516512

517513
@pytest.fixture(scope="module")
518514
def setup_fugue(request):
@@ -551,7 +547,6 @@ def test_fugue(setup_fugue, attr, out_file):
551547
else: setattr(fugue.inputs, key, value)
552548
res = fugue.run()
553549

554-
# NOTE_dj: believe that don't have to use if, since pytest would stop here anyway
555550
assert isdefined(getattr(res.outputs,out_file))
556551
trait_spec = fugue.inputs.trait(out_file)
557552
out_name = trait_spec.name_template % 'dumbfile'

nipype/interfaces/fsl/tests/test_utils.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515

1616
from .test_maths import (set_output_type, create_files_in_directory)
1717

18-
#NOTE_dj: didn't know that some functions are shared between tests files
19-
#NOTE_dj: and changed create_files_in_directory to a fixture with parameters
20-
#NOTE_dj: I believe there's no way to use this fixture for one parameter only
21-
#NOTE_dj: the test works fine for all params so can either leave it as it is or create a new fixture
2218

2319
@pytest.mark.skipif(no_fsl(), reason="fsl is not installed")
2420
def test_fslroi(create_files_in_directory):

nipype/interfaces/tests/test_base.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,6 @@ class InputSpec(nib.TraitedSpec):
485485
class DerivedInterface1(nib.BaseInterface):
486486
input_spec = InputSpec
487487
obj = DerivedInterface1()
488-
#NOTE_dj: removed yield assert_not_raises, if it raises the test will fail anyway
489488
obj._check_version_requirements(obj.inputs)
490489

491490
config.set('execution', 'stop_on_unknown_version', True)
@@ -511,7 +510,6 @@ class DerivedInterface1(nib.BaseInterface):
511510
input_spec = InputSpec
512511
_version = '0.10'
513512
obj = DerivedInterface1()
514-
#NOTE_dj: removed yield assert_not_raises
515513
obj._check_version_requirements(obj.inputs)
516514

517515
class InputSpec(nib.TraitedSpec):
@@ -523,7 +521,6 @@ class DerivedInterface1(nib.BaseInterface):
523521
obj = DerivedInterface1()
524522
obj.inputs.foo = 1
525523
not_raised = True
526-
#NOTE_dj: removed yield assert_not_raises
527524
obj._check_version_requirements(obj.inputs)
528525

529526
class InputSpec(nib.TraitedSpec):
@@ -545,7 +542,6 @@ class DerivedInterface1(nib.BaseInterface):
545542
obj = DerivedInterface1()
546543
obj.inputs.foo = 1
547544
not_raised = True
548-
#NOTE_dj: removed yield assert_not_raises
549545
obj._check_version_requirements(obj.inputs)
550546

551547

@@ -712,11 +708,6 @@ def test_global_CommandLine_output(setup_file):
712708
res = ci.run()
713709
assert res.runtime.stdout == ''
714710

715-
#NOTE_dj: not sure if this function is needed
716-
#NOTE_dj: if my changes are accepted, I'll remove it
717-
def assert_not_raises(fn, *args, **kwargs):
718-
fn(*args, **kwargs)
719-
return True
720711

721712
def check_dict(ref_dict, tst_dict):
722713
"""Compare dictionaries of inputs and and those loaded from json files"""

nipype/interfaces/tests/test_io.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ def test_s3datagrabber():
6060
assert dg.inputs.template_args == {'outfiles': []}
6161

6262

63-
# NOTE_dj: changed one long test for a shorter one with parametrize; for every template and set of attributes I'm checking now the same set of fields using assert
64-
# NOTE_dj: in io.py, an example has different syntax with a node dg = Node(SelectFiles(templates), "selectfiles")
6563
templates1 = {"model": "interfaces/{package}/model.py",
6664
"preprocess": "interfaces/{package}/pre*.py"}
6765
templates2 = {"converter": "interfaces/dcm{to!s}nii.py"}
@@ -404,7 +402,7 @@ def test_freesurfersource():
404402
assert fss.inputs.subject_id == Undefined
405403
assert fss.inputs.subjects_dir == Undefined
406404

407-
#NOTE_dj: I split the test_jsonsink, didn't find connection between two parts, could easier use parametrize for the second part
405+
408406
def test_jsonsink_input(tmpdir):
409407

410408
ds = nio.JSONFileSink()

0 commit comments

Comments
 (0)