diff --git a/testsuite/MDAnalysisTests/analysis/test_distances.py b/testsuite/MDAnalysisTests/analysis/test_distances.py index 238f9579aea..6c380203460 100644 --- a/testsuite/MDAnalysisTests/analysis/test_distances.py +++ b/testsuite/MDAnalysisTests/analysis/test_distances.py @@ -16,14 +16,18 @@ from __future__ import print_function import MDAnalysis -import MDAnalysis.analysis.distances +from MDAnalysisTests import module_not_found -from numpy.testing import TestCase, assert_equal +from numpy.testing import TestCase, assert_equal, dec import numpy as np class TestContactMatrix(TestCase): + + @dec.skipif(module_not_found('scipy'), + "Test skipped because scipy is not available.") def setUp(self): + import MDAnalysis.analysis.distances self.coord = np.array([[1, 1, 1], [5, 5, 5], [1.1, 1.1, 1.1], diff --git a/testsuite/MDAnalysisTests/analysis/test_leaflet.py b/testsuite/MDAnalysisTests/analysis/test_leaflet.py index 5e1ed5e8a99..939568acb4f 100644 --- a/testsuite/MDAnalysisTests/analysis/test_leaflet.py +++ b/testsuite/MDAnalysisTests/analysis/test_leaflet.py @@ -14,14 +14,16 @@ # J. Comput. Chem. 32 (2011), 2319--2327, doi:10.1002/jcc.21787 # import MDAnalysis -from MDAnalysis.analysis.leaflet import LeafletFinder +from MDAnalysisTests import module_not_found -from numpy.testing import TestCase, assert_equal +from numpy.testing import TestCase, assert_equal, dec import numpy as np from MDAnalysisTests.datafiles import Martini_membrane_gro class TestLeafletFinder(TestCase): + @dec.skipif(module_not_found('scipy'), + "Test skipped because scipy is not available.") def setUp(self): self.universe = MDAnalysis.Universe(Martini_membrane_gro, Martini_membrane_gro) self.lipid_heads = self.universe.select_atoms("name PO4") @@ -30,6 +32,7 @@ def tearDown(self): del self.universe def test_leaflet_finder(self): + from MDAnalysis.analysis.leaflet import LeafletFinder lfls = LeafletFinder(self.universe, self.lipid_heads, pbc=True) top_heads, bottom_heads = lfls.groups() # Make top be... on top.