Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[MAINT] Outsource checks of inputs from interface #2799

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 25 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7cb2038
[MAINT] Outsource checks of inputs from interface
oesteban Nov 25, 2018
a15c6fb
remove forgotten print
oesteban Nov 25, 2018
a3600d9
fix mutually-exclusive check
oesteban Nov 25, 2018
c095d65
fix bug trying to append a spec.xor that is None
oesteban Nov 25, 2018
61d553c
fix precedence
oesteban Nov 25, 2018
1ade70c
outsource ``_check_version_requirements``
oesteban Nov 25, 2018
94c0823
fix multiple xor check
oesteban Nov 25, 2018
fddec69
fix check_requires for non-mandatory requires
oesteban Nov 25, 2018
34cb9c9
fix massaging xored inputs
oesteban Nov 25, 2018
523475e
Merge remote-tracking branch 'upstream/master' into maint/outsource-c…
oesteban Nov 25, 2018
41a48bd
fix test_extra_Registration
oesteban Nov 25, 2018
8f8ceb1
fixed fsl.utils doctests
oesteban Nov 25, 2018
d0c6ab8
cmdline returns ``None`` instead of raising if error on inputs
oesteban Nov 25, 2018
1b948cf
fix one more use-case
oesteban Nov 25, 2018
1a558a4
fixed tests
oesteban Nov 25, 2018
b08b5ad
fix errors checking xor
oesteban Nov 25, 2018
44a724d
fix fs.preprocess test
oesteban Nov 25, 2018
f7b5650
fix fsl.tests.test_preprocess
oesteban Nov 26, 2018
294850b
fix fsl.tests.test_preprocess
oesteban Nov 26, 2018
13ac0b9
Merge branch 'maint/outsource-checks' of github.com:oesteban/nipype i…
oesteban Nov 26, 2018
89da56a
install caplog fixture
oesteban Nov 26, 2018
fff59eb
pin pytest>=3.4 for reliable caplog fixture
oesteban Nov 26, 2018
ce41579
Merge branch 'master' into maint/outsource-checks
oesteban Nov 27, 2018
7967b08
Merge remote-tracking branch 'upstream/master' into maint/outsource-c…
oesteban Nov 28, 2018
2d5fd05
Merge branch 'maint/outsource-checks' of github.com:oesteban/nipype i…
oesteban Nov 28, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixed tests
  • Loading branch information
oesteban committed Nov 25, 2018
commit 1a558a4d0250191afec8f13927810cb863c1f51e
21 changes: 12 additions & 9 deletions 21 nipype/interfaces/freesurfer/tests/test_preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from nipype.interfaces.freesurfer import Info
from nipype import LooseVersion
from nipype.utils import errors as nue
from nipype.utils.tests.test_cmd import capture_sys_output


@pytest.mark.skipif(
Expand Down Expand Up @@ -128,7 +129,7 @@ def test_mandatory_outvol(create_files_in_directory):
assert mni.cmdline is None
# test raising error with mandatory args absent
with pytest.raises(nue.MandatoryInputError):
mni.cmdline
mni.run()

# test with minimal args
mni.inputs.in_file = filelist[0]
Expand All @@ -155,19 +156,20 @@ def test_mandatory_outvol(create_files_in_directory):

@pytest.mark.skipif(
fs.no_freesurfer(), reason="freesurfer is not installed")
def test_bbregister(capsys, create_files_in_directory):
def test_bbregister(create_files_in_directory):
filelist, outdir = create_files_in_directory
bbr = fs.BBRegister()

# make sure command gets called
assert bbr.cmd == "bbregister"

# cmdline issues a warning in this stats
assert bbr.cmdline is None
captured = capsys.readouterr()
with capture_sys_output() as (stdout, stderr):
assert bbr.cmdline is None

assert 'WARNING' in captured.out
assert 'Some inputs are not valid.' in captured.out
captured = stdout.getvalue()
assert 'WARNING' in captured
assert 'Command line could not be generated' in captured

# test raising error with mandatory args absent
with pytest.raises(nue.MandatoryInputError):
Expand All @@ -179,9 +181,10 @@ def test_bbregister(capsys, create_files_in_directory):

# Check that 'init' is mandatory in FS < 6, but not in 6+
if Info.looseversion() < LooseVersion("6.0.0"):
assert bbr.cmdline is None
captured = capsys.readouterr()
assert 'Some inputs are not valid.' in captured.out
with capture_sys_output() as (stdout, stderr):
assert bbr.cmdline is None
captured = stdout.getvalue()
assert 'Command line could not be generated' in captured

with pytest.raises(nue.VersionIOError):
bbr.run()
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.