Skip to content
Merged
Show file tree
Hide file tree
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
16 changes: 11 additions & 5 deletions mayavi/tests/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,17 @@ def find_tests(tests):
try:
# Import the module
components = test.split('.')
modname = '.'.join(components[:-1])
symbol = components[-1]
mod = __import__(modname, globals(), locals(), [symbol])
s = getattr(mod, symbol)
d = dirname(s.__file__)
if len(components) > 1:
modname = '.'.join(components[:-1])
symbol = components[-1]
mod = __import__(modname, globals(), locals(), [symbol])
s = getattr(mod, symbol)
d = dirname(s.__file__)
else:
modname = components[0]
mod = __import__(modname, globals(), locals(), [])
d = dirname(mod.__file__)

files.extend(get_tests_in_dir(d))
except ImportError:
msg = 'Warning: %s is neither a file/directory or '\
Expand Down
2 changes: 1 addition & 1 deletion mayavi/tests/test_contour.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from mayavi.modules.contour_grid_plane import ContourGridPlane
from mayavi.modules.scalar_cut_plane import ScalarCutPlane

from . import datasets
from mayavi.tests import datasets

class TestContour(unittest.TestCase):

Expand Down
2 changes: 1 addition & 1 deletion mayavi/tests/test_grid_plane.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from io import BytesIO
import copy
import unittest
from . import datasets
from mayavi.tests import datasets

# Local imports.
from mayavi.core.engine import Engine
Expand Down
2 changes: 1 addition & 1 deletion mayavi/tests/test_image_data_probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import unittest

# Local imports.
from .common import get_example_data
from mayavi.tests.common import get_example_data

# Enthought library imports
from mayavi.core.null_engine import NullEngine
Expand Down
2 changes: 1 addition & 1 deletion mayavi/tests/test_image_data_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import numpy

# Local imports.
from .common import get_example_data
from mayavi.tests.common import get_example_data

# Enthought library imports
from mayavi.sources.image_reader import ImageReader
Expand Down
2 changes: 1 addition & 1 deletion mayavi/tests/test_mlab_scene_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from mayavi.tools.mlab_scene_model import MlabSceneModel
from mayavi import mlab

from .test_mlab_integration import TestMlabNullEngine
from mayavi.tests.test_mlab_integration import TestMlabNullEngine

###############################################################################
# class `TestMlabSceneModel`
Expand Down
2 changes: 1 addition & 1 deletion mayavi/tests/test_optional_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from mayavi.modules.api import Surface
from mayavi.sources.vtk_data_source import VTKDataSource

from . import datasets
from mayavi.tests import datasets

class TestOptionalCollection(unittest.TestCase):

Expand Down
2 changes: 1 addition & 1 deletion mayavi/tests/test_plot3d_mb_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import unittest

# Local imports.
from .common import get_example_data
from mayavi.tests.common import get_example_data

# Enthought library imports
from mayavi.core.null_engine import NullEngine
Expand Down
2 changes: 1 addition & 1 deletion mayavi/tests/test_poly_data_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import unittest

# Local imports.
from .common import get_example_data
from mayavi.tests.common import get_example_data

# Enthought library imports
from mayavi.sources.poly_data_reader import PolyDataReader
Expand Down
2 changes: 1 addition & 1 deletion mayavi/tests/test_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from mayavi.core.pipeline_info import PipelineInfo

# Local Imports
from .common import get_example_data
from mayavi.tests.common import get_example_data

class DummyReader(PLOT3DReader):

Expand Down
2 changes: 1 addition & 1 deletion mayavi/tests/test_set_active_attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from mayavi.modules.api import Surface, Outline

# Local imports.
from .common import get_example_data
from mayavi.tests.common import get_example_data

class TestSetActiveAttribute(unittest.TestCase):

Expand Down
2 changes: 1 addition & 1 deletion mayavi/tests/test_unstructured_data_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from mayavi.tests.data_reader_test_base import DataReaderTestBase

# Local imports.
from .common import get_example_data
from mayavi.tests.common import get_example_data

old_pipeline = is_old_pipeline()

Expand Down
2 changes: 1 addition & 1 deletion mayavi/tests/test_vtk_data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from mayavi.modules.scalar_cut_plane import ScalarCutPlane
from tvtk.api import tvtk

from . import datasets
from mayavi.tests import datasets

class TestVTKDataSource(unittest.TestCase):

Expand Down
2 changes: 1 addition & 1 deletion mayavi/tests/test_vtk_file_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from mayavi.sources.vtk_file_reader import VTKFileReader

# Local imports.
from .common import get_example_data
from mayavi.tests.common import get_example_data

vtk_major_version = vtk.vtkVersion.GetVTKMajorVersion()
vtk_minor_version = vtk.vtkVersion.GetVTKMinorVersion()
Expand Down
2 changes: 1 addition & 1 deletion mayavi/tests/test_vtk_xml_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from mayavi.modules.scalar_cut_plane import ScalarCutPlane

# Local imports.
from .common import get_example_data
from mayavi.tests.common import get_example_data

class TestVTKXMLReader(unittest.TestCase):

Expand Down