For Issue #2286: Updating test_flaskr to use yield inside fixture
This commit is contained in:
parent
4e9d51b39b
commit
378a11f992
2 changed files with 8 additions and 17 deletions
|
|
@ -22,13 +22,9 @@ def client(request):
|
|||
client = flaskr.app.test_client()
|
||||
with flaskr.app.app_context():
|
||||
flaskr.init_db()
|
||||
|
||||
def teardown():
|
||||
os.close(db_fd)
|
||||
os.unlink(flaskr.app.config['DATABASE'])
|
||||
request.addfinalizer(teardown)
|
||||
|
||||
return client
|
||||
yield client
|
||||
os.close(db_fd)
|
||||
os.unlink(flaskr.app.config['DATABASE'])
|
||||
|
||||
|
||||
def login(client, username, password):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue