Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions nibabel/tests/test_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@
from os.path import (dirname, join as pjoin, abspath)
import numpy as np

from hypothesis import given
import hypothesis.strategies as st

try:
import hypothesis
from hypothesis import given
import hypothesis.strategies as st
except Exception as exc:
from nose import SkipTest
raise SkipTest("Failed to import hypothesis or its components: %s" % exc)
Copy link
Member

Choose a reason for hiding this comment

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

To avoid necessarily skipping the entire file, what about making this except statement:

except ImportError:
    class st(object):
        @classmethod
        def data(klass):
            return None

    def given(obj):
        def decorator(func):
            def null_test():
                return None
        return decorator

Maybe raise a warning, as well.


DATA_PATH = abspath(pjoin(dirname(__file__), 'data'))

Expand Down