Skip to content

MRG: Cleaner tests #254

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

Merged
merged 3 commits into from
Oct 13, 2014
Merged

MRG: Cleaner tests #254

merged 3 commits into from
Oct 13, 2014

Conversation

larsoner
Copy link
Contributor

In the process of working on #253 I was a little bit surprised by the number of warnings during testing. This cleans that up, and fixes a couple minor errors along the way.

Ready for review/merge.

@@ -55,7 +55,7 @@ the array.
>>> slice_1 = epi_img_data[:, 30, :]
>>> slice_2 = epi_img_data[:, :, 16]
>>> show_slices([slice_0, slice_1, slice_2])
>>> plt.suptitle("Center slices for EPI image")
>>> plt.suptitle("Center slices for EPI image") # doctest: +SKIP
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These skips were necessary on my system or tests would fail.

Copy link
Member

Choose a reason for hiding this comment

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

What happens on your system for these? Presumably you are running make doctests on the docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, let me test again on current master...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

e.g.:

larsoner@bunk:~/custombuilds/nibabel$ make testmanual
F..F
======================================================================
FAIL: Doctest: coordinate_systems.rst
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/doctest.py", line 2226, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for coordinate_systems.rst
  File "/home/larsoner/custombuilds/nibabel/doc/source/coordinate_systems.rst", line 0

----------------------------------------------------------------------
File "/home/larsoner/custombuilds/nibabel/doc/source/coordinate_systems.rst", line 58, in coordinate_systems.rst
Failed example:
    plt.suptitle("Center slices for EPI image")
Expected nothing
Got:
    <matplotlib.text.Text object at 0x2b0f27e16790>

Copy link
Member

Choose a reason for hiding this comment

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

Try adding a semicolon at the end of the line instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That should indeed suppress it, I'll add it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

...actually it does not suppress it. Back to the SKIP?

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling 80683ea on Eric89GXL:clean-tests into 66b8d38 on nipy:master.

@larsoner
Copy link
Contributor Author

@matthew-brett if you are happy with this, it would be good to get this in sooner rather than later since it touches a lot of files.

@larsoner larsoner changed the title FIX: Cleaner tests MRG: Cleaner tests Sep 13, 2014
@larsoner larsoner mentioned this pull request Sep 29, 2014
8 tasks
@@ -304,7 +304,7 @@ def get_affine(self):
# column, slice)
vox = self.voxel_sizes
ipp = self.image_position
if None in (orient, vox, ipp):
if orient is None or vox is None or ipp is None:
Copy link
Member

Choose a reason for hiding this comment

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

Maybe any(p is None for p in (orient, vox, ipp)) as below, for beauty?

@larsoner
Copy link
Contributor Author

Rebased for good measure. Only the FIX: Minor fixes change is new, which makes the suggested changes, but no ; for SKIP because it didn't work.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling 1c6738d on Eric89GXL:clean-tests into 5e00fd2 on nipy:master.

@larsoner
Copy link
Contributor Author

Latest commit adds the suppress_warnings functionality, works well.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) when pulling fb605c9 on Eric89GXL:clean-tests into 5e00fd2 on nipy:master.

@matthew-brett
Copy link
Member

OK - thanks for that - will merge when the travis tests are done.

@larsoner
Copy link
Contributor Author

Cool, looks like that's already happened :)

matthew-brett added a commit that referenced this pull request Oct 13, 2014
MRG: Cleaner tests

In the process of working on #253 I was a little bit surprised by the number of warnings during testing. This cleans that up, and fixes a couple minor errors along the way.
@matthew-brett matthew-brett merged commit 1b2d201 into nipy:master Oct 13, 2014
@larsoner larsoner deleted the clean-tests branch October 24, 2014 19:02
grlee77 pushed a commit to grlee77/nibabel that referenced this pull request Mar 15, 2016
MRG: Cleaner tests

In the process of working on nipy#253 I was a little bit surprised by the number of warnings during testing. This cleans that up, and fixes a couple minor errors along the way.
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.

3 participants