Skip to content

MATLAB's test_run_interface FAILS #3432

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
dmartindeblas opened this issue Feb 11, 2022 · 1 comment · Fixed by #3650
Closed

MATLAB's test_run_interface FAILS #3432

dmartindeblas opened this issue Feb 11, 2022 · 1 comment · Fixed by #3650

Comments

@dmartindeblas
Copy link
Contributor

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.

@effigies
Copy link
Member

Yes, that looks correct. It seems that we don't have any CI builds that install the MATLAB runtime. Please feel free to submit a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants