Skip to content
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

TEST: Convert FreeSurfer tests to pytest #881

Merged
merged 32 commits into from
Feb 7, 2020

Conversation

orduek
Copy link
Collaborator

@orduek orduek commented Feb 5, 2020

please note that line 66 creates an error (as the assertion is false). I don't know if we should just omit it or should I change something.

@codecov
Copy link

codecov bot commented Feb 5, 2020

Codecov Report

Merging #881 into pytest will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           pytest     #881   +/-   ##
=======================================
  Coverage   91.51%   91.51%           
=======================================
  Files          97       97           
  Lines       12403    12403           
  Branches     2185     2185           
=======================================
  Hits        11351    11351           
  Misses        708      708           
  Partials      344      344           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 27f0f03...27f0f03. Read the comment docs.

Copy link
Member

@effigies effigies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! The line 66 error is easily fixed (I think).

I made some style suggestions.

Also, I think you'll need to add test_io to the ignore list in Azure:

-I test_array_sequence ^
-I test_tractogram ^
-I test_api_validators ^
-I test_arrayproxy ^
-I test_arraywriters ^
-I test_batteryrunners ^
-I test_brikhead ^
-I test_casting ^
-I test_cifti2io_header ^
-I test_data ^
-I test_deprecated ^
-I test_deprecator ^
-I test_dft ^
-I test_ecat ^
-I test_ecat_data ^
-I test_endiancodes ^
-I test_environment ^
-I test_euler ^
-I test_filebasedimages ^
-I test_filehandles ^
-I test_fileholders ^
-I test_filename_parser ^
-I test_files_interface ^
-I test_fileslice ^
-I test_fileutils ^
-I test_floating ^
-I test_funcs ^
-I test_giftiio ^
-I test_h5py_compat ^
-I test_image_api ^
-I test_image_load_save ^
-I test_image_types ^
-I test_imageclasses ^
-I test_imageglobals ^
-I test_keywordonly ^
-I test_loadsave ^
-I test_minc1 ^
-I test_minc2 ^
-I test_minc2_data ^
-I test_mriutils ^
-I test_netcdf ^
-I test_nibabel_data ^
-I test_nifti1 ^
-I test_nifti2 ^
-I test_openers ^
-I test_optpkg ^
-I test_orientations ^
-I test_parrec ^
-I test_parrec_data ^
-I test_pkg_info ^
-I test_processing ^
-I test_proxy_api ^
-I test_quaternions ^
-I test_recoder ^
-I test_remmovalschedule ^
-I test_round_trip ^
-I test_rstutils ^
-I test_scaling ^
-I test_wrapstruct

and Travis:

nibabel/.travis.yml

Lines 131 to 189 in 979b439

-I test_array_sequence \
-I test_tractogram \
-I test_api_validators \
-I test_arrayproxy \
-I test_arraywriters \
-I test_batteryrunners \
-I test_brikhead \
-I test_casting \
-I test_cifti2io_header \
-I test_data \
-I test_deprecated \
-I test_deprecator \
-I test_dft \
-I test_ecat \
-I test_ecat_data \
-I test_endiancodes \
-I test_environment \
-I test_euler \
-I test_filebasedimages \
-I test_filehandles \
-I test_fileholders \
-I test_filename_parser \
-I test_files_interface \
-I test_fileslice \
-I test_fileutils \
-I test_floating \
-I test_funcs \
-I test_giftiio \
-I test_h5py_compat \
-I test_image_api \
-I test_image_load_save \
-I test_image_types \
-I test_imageclasses \
-I test_imageglobals \
-I test_keywordonly \
-I test_loadsave \
-I test_minc1 \
-I test_minc2 \
-I test_minc2_data \
-I test_mriutils \
-I test_netcdf \
-I test_nibabel_data \
-I test_nifti1 \
-I test_nifti2 \
-I test_openers \
-I test_optpkg \
-I test_orientations \
-I test_parrec \
-I test_parrec_data \
-I test_pkg_info \
-I test_processing \
-I test_proxy_api \
-I test_quaternions \
-I test_recoder \
-I test_remmovalschedule \
-I test_round_trip \
-I test_rstutils \
-I test_scaling \
-I test_wrapstruct

nibabel/freesurfer/tests/test_io.py Outdated Show resolved Hide resolved
nibabel/freesurfer/tests/test_io.py Outdated Show resolved Hide resolved
nibabel/freesurfer/tests/test_io.py Outdated Show resolved Hide resolved
nibabel/freesurfer/tests/test_io.py Outdated Show resolved Hide resolved
nibabel/freesurfer/tests/test_io.py Outdated Show resolved Hide resolved
nibabel/freesurfer/tests/test_io.py Outdated Show resolved Hide resolved
nibabel/freesurfer/tests/test_io.py Outdated Show resolved Hide resolved
@@ -272,7 +272,7 @@ def test_write_annot_fill_ctab():
print(labels)
with clear_and_catch_warnings() as w:
write_annot(annot_path, labels, rgbal, names, fill_ctab=False)
assert_true(
assert (
any('Annotation values in {} will be incorrect'.format(
annot_path) == str(ww.message) for ww in w))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can become:

assert any('Annotation values in {} will be incorrect'.format(annot_path) == str(ww.message)
           for ww in w)

Similarly below.

nibabel/freesurfer/tests/test_mghformat.py Show resolved Hide resolved
nibabel/freesurfer/tests/test_mghformat.py Outdated Show resolved Hide resolved
orduek and others added 16 commits February 5, 2020 17:18
Co-Authored-By: Chris Markiewicz <effigies@gmail.com>
Co-Authored-By: Chris Markiewicz <effigies@gmail.com>
Co-Authored-By: Chris Markiewicz <effigies@gmail.com>
Co-Authored-By: Chris Markiewicz <effigies@gmail.com>
Co-Authored-By: Chris Markiewicz <effigies@gmail.com>
Co-Authored-By: Chris Markiewicz <effigies@gmail.com>
Co-Authored-By: Chris Markiewicz <effigies@gmail.com>
Co-Authored-By: Chris Markiewicz <effigies@gmail.com>
Co-Authored-By: Chris Markiewicz <effigies@gmail.com>
Co-Authored-By: Chris Markiewicz <effigies@gmail.com>
@effigies
Copy link
Member

effigies commented Feb 6, 2020

Hi @orduek. For some reason GitHub isn't letting me comment on the diff this morning, so I just went ahead and made the changes I was going to suggest. See orduek#1. If you're okay with all of those changes, go ahead and merge that PR. It will update this one and should trigger the CI.

@effigies effigies changed the title Test/pytest freesurfer TEST: Convert FreeSurfer tests to pytest Feb 6, 2020
@orduek
Copy link
Collaborator Author

orduek commented Feb 6, 2020

Thanks!
Merged these comments here. Let me know if anything else is needed to be done

Copy link
Member

@effigies effigies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like only one test failure:

nibabel/freesurfer/tests/test_mghformat.py Outdated Show resolved Hide resolved
Copy link
Member

@effigies effigies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Let's see what the CI says...

@effigies effigies merged commit baab901 into nipy:pytest Feb 7, 2020
@effigies
Copy link
Member

effigies commented Feb 7, 2020

Nice work! Thanks.

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 this pull request may close these issues.

2 participants