Skip to content
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

Fix failing test for custom import in some circumstances #364

Merged
merged 1 commit into from Apr 29, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions tvtk/tests/test_tvtk.py
Expand Up @@ -95,6 +95,11 @@ def test_cache(self):
def test_custom(self):
"""Test if custom modules can be imported."""

# First clear the cache. Another module may have already imported
# the same class and this would compromise the test
from tvtk.tvtk_classes import tvtk_helper
tvtk_helper._cache.clear()

# Hack to simulate a module inside tvtk.custom.
mod = types.ModuleType('xml_data_reader')

Expand All @@ -119,6 +124,7 @@ def f(self):

# Clean up.
del sys.modules['tvtk.custom.xml_data_reader']
tvtk_helper._cache.clear()

def test_basic(self):
"""Test a simple tvtk pipeline."""
Expand Down