Removed useless import and adapted tests
This commit is contained in:
parent
9248a7baca
commit
dffb3d091c
2 changed files with 3 additions and 4 deletions
1
flask.py
1
flask.py
|
|
@ -12,7 +12,6 @@
|
|||
from __future__ import with_statement
|
||||
import os
|
||||
import sys
|
||||
import types
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from jinja2 import Environment, PackageLoader, FileSystemLoader
|
||||
|
|
|
|||
|
|
@ -255,17 +255,17 @@ class BasicFunctionalityTestCase(unittest.TestCase):
|
|||
== '/static/index.html'
|
||||
|
||||
def test_none_response(self):
|
||||
warnings.filterwarnings('error', 'View function did not return')
|
||||
app = flask.Flask(__name__)
|
||||
@app.route('/')
|
||||
def test():
|
||||
return None
|
||||
try:
|
||||
app.test_client().get('/')
|
||||
except Warning:
|
||||
except ValueError, e:
|
||||
assert str(e) == 'View function did not return a response'
|
||||
pass
|
||||
else:
|
||||
assert "Expected warning"
|
||||
assert "Expected ValueError"
|
||||
|
||||
|
||||
class JSONTestCase(unittest.TestCase):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue