Browse Source

Add discussion to NoImportsTestCase.

pull/379/head
Ron DuPlain 13 years ago
parent
commit
970de5e8b6
  1. 10
      flask/testsuite/helpers.py

10
flask/testsuite/helpers.py

@ -332,7 +332,15 @@ class LoggingTestCase(FlaskTestCase):
class NoImportsTestCase(FlaskTestCase): class NoImportsTestCase(FlaskTestCase):
"Test Flasks are created without __import__." """Test Flasks are created without import.
Avoiding ``__import__`` helps create Flask instances where there are errors
at import time. Those runtime errors will be apparent to the user soon
enough, but tools which build Flask instances meta-programmatically benefit
from a Flask which does not ``__import__``. Instead of importing to
retrieve file paths or metadata on a module or package, use the pkgutil and
imp modules in the Python standard library.
"""
def test_name_with_import_error(self): def test_name_with_import_error(self):
try: try:

Loading…
Cancel
Save