@@ -691,33 +691,39 @@ def run_test(*args, **kwargs):
691
691
return run_test
692
692
693
693
694
- skip_if_32bit = pytest .mark .skipif (8 * struct .calcsize ("P" ) == 32 ,
695
- reason = 'skipped on 32bit platforms' )
696
- skip_travis = pytest .mark .skipif (os .environ .get ('TRAVIS' ) == 'true' ,
697
- reason = 'skip on travis' )
698
-
699
-
700
- # Decorator for tests involving both BLAS calls and multiprocessing.
701
- #
702
- # Under POSIX (e.g. Linux or OSX), using multiprocessing in conjunction with
703
- # some implementation of BLAS (or other libraries that manage an internal
704
- # posix thread pool) can cause a crash or a freeze of the Python process.
705
- #
706
- # In practice all known packaged distributions (from Linux distros or
707
- # Anaconda) of BLAS under Linux seems to be safe. So we this problem seems to
708
- # only impact OSX users.
709
- #
710
- # This wrapper makes it possible to skip tests that can possibly cause
711
- # this crash under OS X with.
712
- #
713
- # Under Python 3.4+ it is possible to use the `forkserver` start method
714
- # for multiprocessing to avoid this issue. However it can cause pickling
715
- # errors on interactively defined functions. It therefore not enabled by
716
- # default.
717
-
718
- if_safe_multiprocessing_with_blas = pytest .mark .skipif (
719
- sys .platform == 'darwin' ,
720
- reason = "Possible multi-process bug with some BLAS" )
694
+ try :
695
+ import pytest
696
+
697
+ skip_if_32bit = pytest .mark .skipif (8 * struct .calcsize ("P" ) == 32 ,
698
+ reason = 'skipped on 32bit platforms' )
699
+ skip_travis = pytest .mark .skipif (os .environ .get ('TRAVIS' ) == 'true' ,
700
+ reason = 'skip on travis' )
701
+
702
+ # Decorator for tests involving both BLAS calls and multiprocessing.
703
+ #
704
+ # Under POSIX (e.g. Linux or OSX), using multiprocessing in conjunction
705
+ # with some implementation of BLAS (or other libraries that manage an
706
+ # internal posix thread pool) can cause a crash or a freeze of the Python
707
+ # process.
708
+ #
709
+ # In practice all known packaged distributions (from Linux distros or
710
+ # Anaconda) of BLAS under Linux seems to be safe. So we this problem seems
711
+ # to only impact OSX users.
712
+ #
713
+ # This wrapper makes it possible to skip tests that can possibly cause
714
+ # this crash under OS X with.
715
+ #
716
+ # Under Python 3.4+ it is possible to use the `forkserver` start method
717
+ # for multiprocessing to avoid this issue. However it can cause pickling
718
+ # errors on interactively defined functions. It therefore not enabled by
719
+ # default.
720
+
721
+ if_safe_multiprocessing_with_blas = pytest .mark .skipif (
722
+ sys .platform == 'darwin' ,
723
+ reason = "Possible multi-process bug with some BLAS" )
724
+
725
+ except ImportError :
726
+ pass
721
727
722
728
723
729
def clean_warning_registry ():
0 commit comments