From 970de5e8b67b6c5bbaac082e888f8ebc6e16cfb7 Mon Sep 17 00:00:00 2001 From: Ron DuPlain Date: Mon, 9 Jan 2012 10:25:06 -0500 Subject: [PATCH] Add discussion to NoImportsTestCase. --- flask/testsuite/helpers.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/flask/testsuite/helpers.py b/flask/testsuite/helpers.py index ee365605..89c6c188 100644 --- a/flask/testsuite/helpers.py +++ b/flask/testsuite/helpers.py @@ -332,7 +332,15 @@ class LoggingTestCase(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): try: