Skip to content

MATLAB's test_run_interface FAILS  #3432

Closed
@dmartindeblas

Description

@dmartindeblas

Summary

When launching the tests as explained here using the master branch of a just-forked nipype repository the test "nipype/interfaces/tests/test_matlab.py::test_run_interface" fails. The reason seems to be that the raised exception is a RuntimeError instead of the expected OSError:

mc = mlab.MatlabCommand(script="foo;", paths=[tmpdir.strpath], mfile=True)
assert not os.path.exists(default_script_file), "scriptfile should not exist 4."
with pytest.raises(OSError):
mc.run()

Actual behavior

Test "nipype/interfaces/tests/test_matlab.py::test_run_interface" fails since it raises a RuntimeError

Expected behavior

Test "nipype/interfaces/tests/test_matlab.py::test_run_interface" passes.

How to replicate the behavior

Running the tests as explained here using the master branch (commit: cd4c34d)

Specifications:

  • OS: Ubuntu 20.04.3 LTS
  • MATLAB version: 2021b (9.11.0.1769968) 64-bit (glnxa64)
  • pytest version: 7.0.0

MATLABCMD enviroment variable was exported to the correct matlab executable

Platform details:

{'commit_hash': 'cd4c34d93',
 'commit_source': 'repository',
 'networkx_version': '2.6.3',
 'nibabel_version': '3.2.2',
 'nipype_version': '1.7.1-dev+gcd4c34d93',
 'numpy_version': '1.22.2',
 'pkg_path': '<repositories_path>/nipype_fork/nipype',
 'scipy_version': '1.8.0',
 'sys_executable': '<anaconda3_path>/envs/nipypedev/bin/python',
 'sys_platform': 'linux',
 'sys_version': '3.9.10 | packaged by conda-forge | (main, Feb  1 2022, '
                '21:24:11) \n'
                '[GCC 9.4.0]',
 'traits_version': '6.3.2'}

Execution environment

  • My python environment outside container

Possible solution

I have replaced the line the OSError exception in line

with pytest.raises(OSError):
with the RuntimeError exception and the tests is passing with my setup, but I ignore if this change will not work for other setups. Let me know if you want that I make a Pull Request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions