Initial checkin
This commit is contained in:
24
test/__init__.py
Normal file
24
test/__init__.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import os
|
||||
import tempfile
|
||||
|
||||
import pytest
|
||||
|
||||
from app import create_app, db, Vehicle
|
||||
from flask import json
|
||||
|
||||
@pytest.fixture
|
||||
def client():
|
||||
app = create_app()
|
||||
|
||||
db_fd, app.config['DATABASE'] = tempfile.mkstemp()
|
||||
app.config['TESTING'] = True
|
||||
client = app.test_client()
|
||||
|
||||
with app.app_context():
|
||||
db.drop_all()
|
||||
db.create_all()
|
||||
|
||||
yield client
|
||||
|
||||
os.close(db_fd)
|
||||
os.unlink(app.config['DATABASE'])
|
||||
Reference in New Issue
Block a user