Skip to content
Myr

Add discussion to NoImportsTestCase.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Ron DuPlain · committed by Ron DuPlain · parent fde6e36 · Browse files · 1 file+9 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+9 added−1 removed

  • other:+9 added−1 removed

1 file+9 added−1 removed

modified:flask/testsuite/helpers.py+9 added-1 removed
330 unmodified lines
331 '/myview/create')332333334class NoImportsTestCase(FlaskTestCase):335 "Test Flasks are created without __import__."335 """Test Flasks are created without import.336337 Avoiding ``__import__`` helps create Flask instances where there are errors338 at import time. Those runtime errors will be apparent to the user soon339 enough, but tools which build Flask instances meta-programmatically benefit340 from a Flask which does not ``__import__``. Instead of importing to341 retrieve file paths or metadata on a module or package, use the pkgutil and342 imp modules in the Python standard library.343 """344345 def test_name_with_import_error(self):346 try:347 flask.Flask('importerror')348 except NotImplementedError:
11 unmodified lines