In order to ensure the stability of each release of Nipype, the project uses two continuous integration services: CircleCI and Travis CI. If both batteries of tests are passing, the following badges should be shown in green color:
Installation for developers¶
To check out the latest development version:
git clone https://github.com/nipy/nipype.git
cd nipype pip install -r requirements.txt pip install -e .[dev]
Nipype testing framework is built upon pytest.
After installation in developer mode, the tests can be run with the following command at the root folder of the project
pytest -v --doctest-modules nipype
A successful test run should complete in 10-30 minutes and end with something like:
---------------------------------------------------------------------- 2445 passed, 41 skipped, 7 xfailed in 1277.66 seconds
No test should fail (unless you’re missing a dependency). If the
environment variable is not set, some FreeSurfer related tests will fail.
If any of the tests failed, please report them on our bug tracker.
On Debian systems with a local copy of MATLAB installed, set the following environment variable before running tests:
$pathtomatlabdir is the path to your matlab installation and
$platform is the directory referring to x86 or x64 installations
glnxa64 on 64-bit installations).
Nipype will skip some tests depending on the currently available software and data dependencies. Installing software dependencies and downloading the necessary data will reduce the number of skipped tests.
A few tests in Nipype make use of some images distributed within the FSL course data. This reduced version of the package can be downloaded here.
To enable the tests depending on these data, just unpack the targz file and set the
variable to point to that folder.
Note, that the test execution time can increase significantly with these additional tests.
Some tests are expect to fail until the code will be changed or for other reasons.
Testing Nipype using Docker¶
Nipype is tested inside Docker containers and users can use nipype images to test local versions. First, install the Docker Engine. Nipype has one base docker image called nipype/nipype:base, that contains several useful tools (FreeSurfer, AFNI, FSL, ANTs, etc.), and additional test images for specific Python versions: py27 for Python 2.7 and py36 for Python 3.6.
Users can pull the nipype image for Python 3.6 as follows:
docker pull nipype/nipype:py36
In order to test a local version of nipype you can run test within container as follows:
docker run -it -v $PWD:/src/nipype --rm nipype/nipype:py36 py.test -v --doctest-modules /src/nipype/nipype
If the project is tested both on your local OS and within a Docker container, you might have to remove all
__pycache__ directories before switching between your OS and a container.