forked from orbit-oss/flask
Add discussion to NoImportsTestCase.
This commit is contained in:
parent
fde6e364a4
commit
970de5e8b6
1 changed files with 9 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue