Browse Source

Add a test for importing a package (__init__.py) with a syntax error twice

pull/2588/head
Segev Finer 7 years ago
parent
commit
294c5981e2
  1. 1
      tests/test_apps/cliapp/syntaxerror/__init__.py
  2. 9
      tests/test_cli.py

1
tests/test_apps/cliapp/syntaxerror/__init__.py

@ -0,0 +1 @@
spam()spam()

9
tests/test_cli.py

@ -243,6 +243,15 @@ def test_locate_app_suppress_raise():
)
def test_locate_app_init_syntax_error(test_apps):
info = ScriptInfo()
with pytest.raises(SyntaxError):
locate_app(info, 'cliapp.syntaxerror', None)
with pytest.raises(SyntaxError):
locate_app(info, 'cliapp.syntaxerror', None)
def test_get_version(test_apps, capsys):
"""Test of get_version."""
from flask import __version__ as flask_ver

Loading…
Cancel
Save