Deal with partially setup packages in the redirect hook.

This commit is contained in:
Armin Ronacher 2011-09-21 21:34:47 +02:00
parent ee9b401632
commit 9691b7f0bf
6 changed files with 49 additions and 7 deletions

View file

@ -8,6 +8,8 @@
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import sys
import unittest
from flask.testsuite import FlaskTestCase
@ -92,6 +94,11 @@ class ExtImportHookTestCase(FlaskTestCase):
from flask.ext.oldext_package.submodule import test_function
self.assert_equal(test_function(), 42)
def test_flaskext_broken_package_no_module_caching(self):
for x in xrange(2):
with self.assert_raises(ImportError):
import flask.ext.broken
def suite():
suite = unittest.TestSuite()