Skip to content

Commit 1caa9de

Browse files
accrazedavidism
authored andcommitted
Added missing testing config
fixes pallets#1302
1 parent 7005c2d commit 1caa9de

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/testing.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,10 @@ test method to our class, like this::
9898

9999
def setUp(self):
100100
self.db_fd, flaskr.app.config['DATABASE'] = tempfile.mkstemp()
101+
flaskr.app.config['TESTING'] = True
101102
self.app = flaskr.app.test_client()
102-
flaskr.init_db()
103+
with flaskr.app.app_context():
104+
flaskr.init_db()
103105

104106
def tearDown(self):
105107
os.close(self.db_fd)

0 commit comments

Comments
 (0)