From a754d28302b64dc9d86a5454b15d174b0115fa21 Mon Sep 17 00:00:00 2001 From: lambdadi Date: Mon, 11 Feb 2013 18:55:24 +0530 Subject: [PATCH] Database improperly closed in example code os.unlink(flaskr.DATABASE) causes the actual application database to be purged; whereas, I reckon, one wants the _test_ database to be removed. So every time I ran it, the test passed, but ended up crashing the live app for want of a valid database. I avoided using the sample code in examples/flaskr thus far, as I chose to type out code from the turorial docs. The actual example code looks good - at least to my beginner's eye. --- docs/testing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/testing.rst b/docs/testing.rst index d4d9259c..84a6c277 100644 --- a/docs/testing.rst +++ b/docs/testing.rst @@ -102,7 +102,7 @@ test method to our class, like this:: def tearDown(self): os.close(self.db_fd) - os.unlink(flaskr.DATABASE) + os.unlink(flaskr.app.config['DATABASE']) def test_empty_db(self): rv = self.app.get('/')